From f39bfdab896f1ce0803c8ddc9e6782a9e843c183 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 1 Feb 2022 20:33:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E6=A8=A1=E5=9D=97=E9=87=8D=E6=9E=84?= =?UTF-8?q?=208=EF=BC=9Abom=20=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=B0=9D?= =?UTF-8?q?=E8=AF=95=E5=85=AC=E7=94=A8=E9=83=A8=E5=88=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-admin-server/pom.xml | 25 +------ .../src/main/resources/application.yaml | 5 +- .../framework/web/config/WebProperties.java | 14 ++++ yudao-module-bpm/TODO.md | 5 +- .../module/bpm/enums/ErrorCodeConstants.java | 5 ++ .../yudao-module-bpm-base/pom.xml | 11 +++ .../definition/vo/form/BpmFormBaseVO.java | 1 - .../controller/oa/vo/BpmOALeaveBaseVO.java | 2 +- .../oa/vo/BpmOALeaveCreateReqVO.java | 2 +- .../controller/oa/vo/BpmOALeavePageReqVO.java | 2 +- .../controller/oa/vo/BpmOALeaveRespVO.java | 2 +- .../task/vo/activity/BpmActivityRespVO.java | 2 +- .../BpmProcessInstanceCancelReqVO.java | 2 +- .../BpmProcessInstanceCreateReqVO.java | 2 +- .../BpmProcessInstanceMyPageReqVO.java | 2 +- .../BpmProcessInstancePageItemRespVO.java | 2 +- .../vo/instance/BpmProcessInstanceRespVO.java | 2 +- .../task/vo/task/BpmTaskApproveReqVO.java | 2 +- .../vo/task/BpmTaskDonePageItemRespVO.java | 2 +- .../task/vo/task/BpmTaskDonePageReqVO.java | 2 +- .../task/vo/task/BpmTaskRejectReqVO.java | 2 +- .../task/vo/task/BpmTaskRespVO.java | 4 +- .../vo/task/BpmTaskTodoPageItemRespVO.java | 2 +- .../task/vo/task/BpmTaskTodoPageReqVO.java | 2 +- .../vo/task/BpmTaskUpdateAssigneeReqVO.java | 2 +- .../convert/definition/BpmFormConvert.java | 5 -- .../definition/BpmUserGroupConvert.java | 2 - .../convert/message/BpmMessageConvert.java | 16 +++++ .../module/bpm/convert/oa/package-info.java | 1 + .../module/bpm/convert/task/package-info.java | 1 + .../definition/BpmProcessDefinitionExtDO.java | 9 +-- .../definition/BpmTaskAssignRuleDO.java | 13 ++-- .../bpm/dal/dataobject/oa/BpmOALeaveDO.java | 9 ++- .../task/BpmProcessInstanceExtDO.java | 24 +++---- .../bpm/dal/dataobject/task/BpmTaskExtDO.java | 23 +++---- .../BpmProcessDefinitionExtMapper.java | 2 +- .../definition/BpmTaskAssignRuleMapper.java | 2 +- .../bpm/dal/mysql/oa/BpmOALeaveMapper.java | 4 +- .../task/BpmProcessInstanceExtMapper.java | 4 +- .../bpm/dal/mysql/task/BpmTaskExtMapper.java | 2 +- .../bpm/enums/message/BpmMessageEnum.java | 6 +- .../definition/BpmUserGroupService.java | 9 +++ .../definition/BpmUserGroupServiceImpl.java | 8 ++- .../message/BpmMessageServiceImpl.java | 28 ++++---- .../BpmMessageSendWhenTaskCreatedReqDTO.java | 2 +- .../module/bpm/service/task/package-info.java | 1 + .../definition/BpmModelController.java | 1 - .../controller/oa/BpmOALeaveController.java | 6 +- .../task/BpmActivityController.java | 2 +- .../task/BpmProcessInstanceController.java | 4 +- .../controller/task/BpmTaskController.java | 5 +- .../convert/definition/BpmModelConvert.java | 11 ++- .../BpmProcessDefinitionConvert.java | 8 +-- .../convert/message/BpmMessageConvert.java | 6 +- .../bpm/convert/oa/BpmOALeaveConvert.java | 4 +- .../bpm/convert/task/BpmActivityConvert.java | 2 +- .../task/BpmProcessInstanceConvert.java | 12 ++-- .../bpm/convert/task/BpmTaskConvert.java | 34 ++++----- .../config/BpmActivitiConfiguration.java | 27 ++++---- .../behavior/BpmActivityBehaviorFactory.java | 26 +++---- .../behavior/BpmUserTaskActivitiBehavior.java | 55 ++++++++------- .../BpmTaskAssignLeaderAbstractScript.java | 23 ++++--- .../{impl => }/BpmModelServiceImpl.java | 28 ++++---- .../BpmProcessDefinitionServiceImpl.java | 27 ++++---- .../BpmTaskAssignRuleServiceImpl.java | 46 ++++++------- .../bpm/service/oa/BpmOALeaveService.java | 3 +- .../oa/{impl => }/BpmOALeaveServiceImpl.java | 9 +-- .../oa/listener/BpmOALeaveResultListener.java | 2 +- .../bpm/service/task/BpmActivityService.java | 2 +- .../{impl => }/BpmActivityServiceImpl.java | 9 +-- .../task/BpmProcessInstanceService.java | 2 +- .../BpmProcessInstanceServiceImpl.java | 27 ++++---- .../bpm/service/task/BpmTaskService.java | 2 +- .../task/{impl => }/BpmTaskServiceImpl.java | 31 ++++----- .../BpmUserTaskActivitiBehaviorTest.java | 69 ++++++++++--------- .../impl/BpmTaskAssignLeaderX2ScriptTest.java | 42 +++++------ .../member/convert/auth/AuthConvert.java | 4 +- .../service/user/MemberUserServiceImpl.java | 2 +- .../yudao/module/system/api/dept/DeptApi.java | 50 ++++++++++++++ .../yudao/module/system/api/dept/PostApi.java | 21 ++++++ .../system/api/dept/dto/DeptRespDTO.java | 37 ++++++++++ .../module/system/api/dict/DictDataApi.java | 22 ++++++ .../system/api/permission/PermissionApi.java | 21 ++++++ .../module/system/api/permission/RoleApi.java | 21 ++++++ .../module/system/api/sms/SmsCodeApi.java | 6 +- .../module/system/api/sms/SmsSendApi.java | 34 +++++++++ .../dto/{ => code}/SmsCodeCheckReqDTO.java | 2 +- .../sms/dto/{ => code}/SmsCodeSendReqDTO.java | 2 +- .../sms/dto/{ => code}/SmsCodeUseReqDTO.java | 2 +- .../dto/send/SmsSendSingleToUserReqDTO.java | 38 ++++++++++ .../module/system/api/user/AdminUserApi.java | 58 ++++++++++++++++ .../system/api/user/dto/AdminUserRespDTO.java | 44 ++++++++++++ .../module/system/api/dept/DeptApiImpl.java | 49 +++++++++++++ .../api/permission/PermissionApiImpl.java | 26 +++++++ .../module/system/api/sms/SmsCodeApiImpl.java | 6 +- .../module/system/api/sms/SmsSendApiImpl.java | 34 +++++++++ .../system/api/user/AdminUserApiImpl.java | 55 +++++++++++++++ .../system/convert/dept/DeptConvert.java | 8 +++ .../system/convert/user/UserConvert.java | 9 +++ .../system/service/dept/DeptService.java | 1 - .../system/service/sms/SmsCodeService.java | 6 +- .../service/sms/SmsCodeServiceImpl.java | 11 +-- 102 files changed, 945 insertions(+), 424 deletions(-) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/oa/vo/BpmOALeaveBaseVO.java (94%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java (88%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/oa/vo/BpmOALeavePageReqVO.java (94%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/oa/vo/BpmOALeaveRespVO.java (93%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/activity/BpmActivityRespVO.java (91%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/instance/BpmProcessInstanceCancelReqVO.java (89%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/instance/BpmProcessInstanceCreateReqVO.java (87%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/instance/BpmProcessInstanceMyPageReqVO.java (95%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/instance/BpmProcessInstancePageItemRespVO.java (95%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/instance/BpmProcessInstanceRespVO.java (97%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/task/BpmTaskApproveReqVO.java (90%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java (92%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/task/BpmTaskDonePageReqVO.java (93%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/task/BpmTaskRejectReqVO.java (88%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/task/BpmTaskRespVO.java (91%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/task/BpmTaskTodoPageItemRespVO.java (95%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/task/BpmTaskTodoPageReqVO.java (93%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/controller/task/vo/task/BpmTaskUpdateAssigneeReqVO.java (91%) create mode 100644 yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/message/BpmMessageConvert.java create mode 100644 yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/oa/package-info.java create mode 100644 yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/package-info.java rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java (91%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/dal/mysql/definition/BpmTaskAssignRuleMapper.java (95%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/dal/mysql/oa/BpmOALeaveMapper.java (87%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java (90%) rename yudao-module-bpm/{yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules => yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module}/bpm/dal/mysql/task/BpmTaskExtMapper.java (93%) create mode 100644 yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/task/package-info.java rename yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/{impl => }/BpmModelServiceImpl.java (93%) rename yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/{impl => }/BpmProcessDefinitionServiceImpl.java (96%) rename yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/{impl => }/BpmTaskAssignRuleServiceImpl.java (83%) rename yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/{impl => }/BpmOALeaveServiceImpl.java (89%) rename yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/{impl => }/BpmActivityServiceImpl.java (86%) rename yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/{impl => }/BpmProcessInstanceServiceImpl.java (93%) rename yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/{impl => }/BpmTaskServiceImpl.java (91%) create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsSendApi.java rename yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/{ => code}/SmsCodeCheckReqDTO.java (92%) rename yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/{ => code}/SmsCodeSendReqDTO.java (92%) rename yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/{ => code}/SmsCodeUseReqDTO.java (93%) create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/send/SmsSendSingleToUserReqDTO.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java create mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java create mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java create mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsSendApiImpl.java create mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java diff --git a/yudao-admin-server/pom.xml b/yudao-admin-server/pom.xml index eb5221868..e27f025d7 100644 --- a/yudao-admin-server/pom.xml +++ b/yudao-admin-server/pom.xml @@ -42,28 +42,13 @@ yudao-module-pay-impl ${revision} - - + cn.iocoder.boot - yudao-module-bpm-activiti + yudao-module-bpm-impl-activiti ${revision} - - - - cn.iocoder.boot - yudao-spring-boot-starter-biz-dict - - - - cn.iocoder.boot - yudao-spring-boot-starter-biz-tenant - - - - org.springframework.boot @@ -88,12 +73,6 @@ spring-boot-admin-starter-server - - - - com.xkcoding.justauth - justauth-spring-boot-starter - diff --git a/yudao-admin-server/src/main/resources/application.yaml b/yudao-admin-server/src/main/resources/application.yaml index b352943a8..e5761d5d0 100644 --- a/yudao-admin-server/src/main/resources/application.yaml +++ b/yudao-admin-server/src/main/resources/application.yaml @@ -58,7 +58,8 @@ yudao: app-api: prefix: /app-api controller: '**.controller.app.**' - + admin-ui: + url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址 swagger: title: 管理后台 description: 提供管理员管理的所有功能 @@ -78,8 +79,6 @@ yudao: - cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants tenant: # 多租户相关配置项 tables: # 配置需要开启多租户的表;如果实体已经继承 TenantBaseDO 类,则无需重复配置 - url: ## TODO 芋艿:迁移到 web 配置项下, - admin-ui: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址 sms-code: # 短信验证码相关的配置项 expire-times: 10m send-frequency: 1m diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java index a7058871e..173a67042 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java @@ -19,6 +19,9 @@ public class WebProperties { @NotNull(message = "Admin API 不能为空") private Api adminApi; + @NotNull(message = "Admin UI 不能为空") + private Ui adminUi; + @Data @Valid public static class Api { @@ -45,4 +48,15 @@ public class WebProperties { } + @Data + @Valid + public static class Ui { + + /** + * 访问地址 + */ + private String url; + + } + } diff --git a/yudao-module-bpm/TODO.md b/yudao-module-bpm/TODO.md index 35a2e25b1..d155eaa5f 100644 --- a/yudao-module-bpm/TODO.md +++ b/yudao-module-bpm/TODO.md @@ -1,6 +1,7 @@ 1. 类名可以去掉 Bpm 前缀哈 + 2. 后续接口我们分成 admin 管理后天,app 用户前端;所以 controller 包下,需要有 admin 和 app 两个子包。可见 https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/feature/multi-module/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller -3. yudao-module-xxx-api 是暴露接口给外部模块,所以可以把 yudao-module-bpm-core-service-api 改成 yudao-module-bpm-api。大概率用不了暴露 BpmUserGroupServiceApi 哈。 -4. yudao-module-bpm-core-service-impl 模块,要不改成 yudao-module-bpm-base,本质上是提供给 yudao-module-bpm-flowable-impl 和 yudao-module-bpm-activiti-impl 继承的。这样的话,我们在 yudao-module-bpm-base: + +3. yudao-module-bpm-core-service-impl 模块,要不改成 yudao-module-bpm-base,本质上是提供给 yudao-module-bpm-flowable-impl 和 yudao-module-bpm-activiti-impl 继承的。这样的话,我们在 yudao-module-bpm-base: * 定义一些可被继承的类,例如说 ModelAbstractService; * 定义一些无需被继承的类,例如说 UserGroupService、UserGroupController 等等; diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java index 74281aaac..45fa3fa87 100644 --- a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java +++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java @@ -55,5 +55,10 @@ public interface ErrorCodeConstants { // ========== 动态表单模块 1-009-010-000 ========== ErrorCode FORM_NOT_EXISTS = new ErrorCode(1009010000, "动态表单不存在"); + ErrorCode FORM_FIELD_REPEAT = new ErrorCode(1009010000, "表单项({}) 和 ({}) 使用了相同的字段名({})"); + + // ========== 用户组模块 1-009-011-000 ========== + ErrorCode USER_GROUP_NOT_EXISTS = new ErrorCode(1009011000, "用户组不存在"); + ErrorCode USER_GROUP_IS_DISABLE = new ErrorCode(1009011001, "名字为【{}】的用户组已被禁用"); } diff --git a/yudao-module-bpm/yudao-module-bpm-base/pom.xml b/yudao-module-bpm/yudao-module-bpm-base/pom.xml index 5b839de9e..888942844 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/pom.xml +++ b/yudao-module-bpm/yudao-module-bpm-base/pom.xml @@ -21,6 +21,17 @@ yudao-module-bpm-api ${revision} + + cn.iocoder.boot + yudao-module-system-api + ${revision} + + + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-operatelog + diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/definition/vo/form/BpmFormBaseVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/definition/vo/form/BpmFormBaseVO.java index 6a518b86a..1eb2ccd82 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/definition/vo/form/BpmFormBaseVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/definition/vo/form/BpmFormBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.bpm.controller.definition.vo.form; -import com.sun.istack.internal.NotNull; import lombok.*; import io.swagger.annotations.*; import javax.validation.constraints.*; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveBaseVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeaveBaseVO.java similarity index 94% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveBaseVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeaveBaseVO.java index e7128b50d..6790cf28f 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveBaseVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeaveBaseVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo; +package cn.iocoder.yudao.module.bpm.controller.oa.vo; import lombok.*; import java.util.*; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java similarity index 88% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java index f36e924b1..2e4ec99d0 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo; +package cn.iocoder.yudao.module.bpm.controller.oa.vo; import io.swagger.annotations.ApiModel; import lombok.Data; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeavePageReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeavePageReqVO.java similarity index 94% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeavePageReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeavePageReqVO.java index 7b81455a2..2c7cbb8f0 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeavePageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeavePageReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo; +package cn.iocoder.yudao.module.bpm.controller.oa.vo; import lombok.*; import java.util.*; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveRespVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeaveRespVO.java similarity index 93% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveRespVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeaveRespVO.java index 2b386d8ce..6627c7473 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/oa/vo/BpmOALeaveRespVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo; +package cn.iocoder.yudao.module.bpm.controller.oa.vo; import lombok.*; import io.swagger.annotations.*; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/activity/BpmActivityRespVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/activity/BpmActivityRespVO.java similarity index 91% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/activity/BpmActivityRespVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/activity/BpmActivityRespVO.java index 447c59000..3e6ca5423 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/activity/BpmActivityRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/activity/BpmActivityRespVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.activity; +package cn.iocoder.yudao.module.bpm.controller.task.vo.activity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceCancelReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceCancelReqVO.java similarity index 89% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceCancelReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceCancelReqVO.java index 74f0a86b4..a9e7d0680 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceCancelReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceCancelReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance; +package cn.iocoder.yudao.module.bpm.controller.task.vo.instance; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceCreateReqVO.java similarity index 87% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceCreateReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceCreateReqVO.java index e4fbc95bb..301c7f176 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceCreateReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance; +package cn.iocoder.yudao.module.bpm.controller.task.vo.instance; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceMyPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceMyPageReqVO.java similarity index 95% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceMyPageReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceMyPageReqVO.java index 38965dd88..61ad3a8a2 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceMyPageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceMyPageReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance; +package cn.iocoder.yudao.module.bpm.controller.task.vo.instance; import cn.iocoder.yudao.framework.common.pojo.PageParam; import io.swagger.annotations.ApiModel; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstancePageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstancePageItemRespVO.java similarity index 95% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstancePageItemRespVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstancePageItemRespVO.java index 14a262570..3ca93ecbd 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstancePageItemRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstancePageItemRespVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance; +package cn.iocoder.yudao.module.bpm.controller.task.vo.instance; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceRespVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceRespVO.java similarity index 97% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceRespVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceRespVO.java index de6999c65..75d05e2a7 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/instance/BpmProcessInstanceRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/instance/BpmProcessInstanceRespVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance; +package cn.iocoder.yudao.module.bpm.controller.task.vo.instance; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskApproveReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskApproveReqVO.java similarity index 90% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskApproveReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskApproveReqVO.java index 356581a96..a4af326de 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskApproveReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskApproveReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; +package cn.iocoder.yudao.module.bpm.controller.task.vo.task; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java similarity index 92% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java index b932c4e07..1ba195ab0 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; +package cn.iocoder.yudao.module.bpm.controller.task.vo.task; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskDonePageReqVO.java similarity index 93% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskDonePageReqVO.java index c3d3c6ead..681e5c6e5 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskDonePageReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; +package cn.iocoder.yudao.module.bpm.controller.task.vo.task; import cn.iocoder.yudao.framework.common.pojo.PageParam; import io.swagger.annotations.ApiModel; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskRejectReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskRejectReqVO.java similarity index 88% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskRejectReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskRejectReqVO.java index 4ad498357..19e40b317 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskRejectReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskRejectReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; +package cn.iocoder.yudao.module.bpm.controller.task.vo.task; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskRespVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskRespVO.java similarity index 91% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskRespVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskRespVO.java index a66c9f2af..97dbc826e 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskRespVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; +package cn.iocoder.yudao.module.bpm.controller.task.vo.task; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -6,8 +6,6 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -import java.util.List; - @ApiModel("流程任务的 Response VO") @Data @EqualsAndHashCode(callSuper = true) diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskTodoPageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskTodoPageItemRespVO.java similarity index 95% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskTodoPageItemRespVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskTodoPageItemRespVO.java index 2703b9690..5d1dc6296 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskTodoPageItemRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskTodoPageItemRespVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; +package cn.iocoder.yudao.module.bpm.controller.task.vo.task; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskTodoPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskTodoPageReqVO.java similarity index 93% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskTodoPageReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskTodoPageReqVO.java index d89e582f1..64153b736 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskTodoPageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskTodoPageReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; +package cn.iocoder.yudao.module.bpm.controller.task.vo.task; import cn.iocoder.yudao.framework.common.pojo.PageParam; import io.swagger.annotations.ApiModel; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskUpdateAssigneeReqVO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskUpdateAssigneeReqVO.java similarity index 91% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskUpdateAssigneeReqVO.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskUpdateAssigneeReqVO.java index 0ad6fbedc..400a24577 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskUpdateAssigneeReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/controller/task/vo/task/BpmTaskUpdateAssigneeReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; +package cn.iocoder.yudao.module.bpm.controller.task.vo.task; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmFormConvert.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmFormConvert.java index 9281cc4ab..3baca0916 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmFormConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmFormConvert.java @@ -5,7 +5,6 @@ import cn.iocoder.yudao.module.bpm.controller.definition.vo.form.BpmFormRespVO; import cn.iocoder.yudao.module.bpm.controller.definition.vo.form.BpmFormSimpleRespVO; import cn.iocoder.yudao.module.bpm.controller.definition.vo.form.BpmFormUpdateReqVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; -import cn.iocoder.yudao.module.bpm.api.form.dto.BpmFormDTO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -28,10 +27,6 @@ public interface BpmFormConvert { BpmFormRespVO convert(BpmFormDO bean); - BpmFormDTO convert1(BpmFormDO bean); - - List convertList(List list); - List convertList2(List list); PageResult convertPage(PageResult page); diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmUserGroupConvert.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmUserGroupConvert.java index d30860ef1..02a784551 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmUserGroupConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmUserGroupConvert.java @@ -6,7 +6,6 @@ import cn.iocoder.yudao.module.bpm.controller.definition.vo.group.BpmUserGroupCr import cn.iocoder.yudao.module.bpm.controller.definition.vo.group.BpmUserGroupRespVO; import cn.iocoder.yudao.module.bpm.controller.definition.vo.group.BpmUserGroupUpdateReqVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO; -import cn.iocoder.yudao.module.bpm.api.group.dto.BpmUserGroupDTO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import org.mapstruct.Mapper; @@ -36,5 +35,4 @@ public interface BpmUserGroupConvert { @Named("convertList2") List convertList2(List list); - List convertList3(List list); } diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/message/BpmMessageConvert.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/message/BpmMessageConvert.java new file mode 100644 index 000000000..92683f4c9 --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/message/BpmMessageConvert.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.bpm.convert.message; + +import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.Map; + +@Mapper +public interface BpmMessageConvert { + + BpmMessageConvert INSTANCE = Mappers.getMapper(BpmMessageConvert.class); + + SmsSendSingleToUserReqDTO convert(Long userId, String templateCode, Map templateParams); + +} diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/oa/package-info.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/oa/package-info.java new file mode 100644 index 000000000..be8623fb1 --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/oa/package-info.java @@ -0,0 +1 @@ +package cn.iocoder.yudao.module.bpm.convert.oa; diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/package-info.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/package-info.java new file mode 100644 index 000000000..6a53114a8 --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/package-info.java @@ -0,0 +1 @@ +package cn.iocoder.yudao.module.bpm.convert.task; diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/definition/BpmProcessDefinitionExtDO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/definition/BpmProcessDefinitionExtDO.java index e9f8997f8..57abc0b99 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/definition/BpmProcessDefinitionExtDO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/definition/BpmProcessDefinitionExtDO.java @@ -1,15 +1,12 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.definition; -import cn.iocoder.yudao.adminserver.modules.bpm.enums.definition.BpmModelFormTypeEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; +import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.*; -import org.activiti.engine.repository.Model; -import org.activiti.engine.repository.ProcessDefinition; import java.util.List; @@ -36,13 +33,13 @@ public class BpmProcessDefinitionExtDO extends BaseDO { /** * 流程定义的编号 * - * 关联 {@link ProcessDefinition#getId()} + * 关联 ProcessDefinition 的 id 属性 */ private String processDefinitionId; /** * 流程模型的编号 * - * 关联 {@link Model#getId()} + * 关联 Model 的 id 属性 */ private String modelId; /** diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/definition/BpmTaskAssignRuleDO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/definition/BpmTaskAssignRuleDO.java index 44950c817..e65764f1a 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/definition/BpmTaskAssignRuleDO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/definition/BpmTaskAssignRuleDO.java @@ -1,16 +1,13 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.definition; -import cn.iocoder.yudao.adminserver.modules.bpm.enums.definition.BpmTaskRuleScriptEnum; -import cn.iocoder.yudao.adminserver.modules.bpm.enums.definition.BpmTaskAssignRuleTypeEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler; +import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum; +import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskRuleScriptEnum; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.*; -import org.activiti.engine.repository.Model; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.task.Task; import java.util.Set; @@ -46,19 +43,19 @@ public class BpmTaskAssignRuleDO extends BaseDO { /** * 流程模型编号 * - * 关联 {@link Model#getId()} + * 关联 Model 的 id 属性 */ private String modelId; /** * 流程定义编号 * - * 关联 {@link ProcessDefinition#getId()} + * 关联 ProcessDefinition 的 id 属性 */ private String processDefinitionId; /** * 流程任务的定义 Key * - * 关联 {@link Task#getTaskDefinitionKey()} + * 关联 Task 的 taskDefinitionKey 属性 */ private String taskDefinitionKey; diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOALeaveDO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOALeaveDO.java index 6cad3fcae..31381a556 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOALeaveDO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOALeaveDO.java @@ -1,11 +1,10 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.oa; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; +import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; import lombok.*; import java.util.*; import com.baomidou.mybatisplus.annotation.*; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import org.activiti.engine.runtime.ProcessInstance; /** * OA 请假申请 DO @@ -32,7 +31,7 @@ public class BpmOALeaveDO extends BaseDO { /** * 申请人的用户编号 * - * 关联 {@link SysUserDO#getId()} + * 关联 AdminUserDO 的 id 属性 */ private Long userId; /** @@ -59,7 +58,7 @@ public class BpmOALeaveDO extends BaseDO { /** * 请假的结果 * - * 枚举 {@link cn.iocoder.yudao.adminserver.modules.bpm.enums.task.BpmProcessInstanceResultEnum} + * 枚举 {@link BpmProcessInstanceResultEnum} * 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈 */ private Integer result; @@ -67,7 +66,7 @@ public class BpmOALeaveDO extends BaseDO { /** * 对应的流程编号 * - * 关联 {@link ProcessInstance#getId()} + * 关联 ProcessInstance 的 id 属性 */ private String processInstanceId; diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmProcessInstanceExtDO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmProcessInstanceExtDO.java index ddeed4e97..b37709962 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmProcessInstanceExtDO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmProcessInstanceExtDO.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.task; -import cn.iocoder.yudao.adminserver.modules.bpm.enums.task.BpmProcessInstanceResultEnum; -import cn.iocoder.yudao.adminserver.modules.bpm.enums.task.BpmProcessInstanceStatusEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; +import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceStatusEnum; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -10,16 +10,13 @@ import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -import org.activiti.engine.history.HistoricProcessInstance; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; import java.util.Date; import java.util.Map; /** * Bpm 流程实例的拓展表 - * 主要解决 Activiti {@link ProcessInstance} 和 {@link HistoricProcessInstance} 不支持拓展字段,所以新建拓展表 + * 主要解决 Activiti ProcessInstance 和 HistoricProcessInstance 不支持拓展字段,所以新建拓展表 * * @author 芋道源码 */ @@ -27,9 +24,6 @@ import java.util.Map; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -//@Builder -//@NoArgsConstructor -//@AllArgsConstructor public class BpmProcessInstanceExtDO extends BaseDO { /** @@ -40,31 +34,31 @@ public class BpmProcessInstanceExtDO extends BaseDO { /** * 发起流程的用户编号 * - * 冗余 {@link HistoricProcessInstance#getStartUserId()} + * 冗余 HistoricProcessInstance 的 startUserId 属性 */ private Long startUserId; /** * 流程实例的名字 * - * 冗余 {@link ProcessInstance#getName()} 为了筛选 + * 冗余 ProcessInstance 的 name 属性,用于筛选 */ private String name; /** * 流程实例的编号 * - * 关联 {@link ProcessInstance#getId()} + * 关联 ProcessInstance 的 id 属性 */ private String processInstanceId; /** * 流程定义的编号 * - * 关联 {@link ProcessDefinition#getId()} + * 关联 ProcessDefinition 的 id 属性 */ private String processDefinitionId; /** * 流程分类 * - * 冗余 {@link ProcessDefinition#getCategory()} + * 冗余 ProcessDefinition 的 category 属性 * 数据字典 bpm_model_category */ private String category; @@ -83,7 +77,7 @@ public class BpmProcessInstanceExtDO extends BaseDO { /** * 结束时间 * - * 冗余 {@link HistoricProcessInstance#getEndTime()} + * 冗余 HistoricProcessInstance 的 endTime 属性 */ private Date endTime; diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmTaskExtDO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmTaskExtDO.java index 3fb4f5aa8..9cd12ee3c 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmTaskExtDO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmTaskExtDO.java @@ -1,21 +1,17 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.task; -import cn.iocoder.yudao.adminserver.modules.bpm.enums.task.BpmProcessInstanceResultEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; import java.util.Date; /** * Bpm 流程任务的拓展表 - * 主要解决 Activiti {@link Task} 和 {@link HistoricTaskInstance} 不支持拓展字段,所以新建拓展表 + * 主要解决 Activiti Task 和 HistoricTaskInstance 不支持拓展字段,所以新建拓展表 * * @author 芋道源码 */ @@ -23,27 +19,24 @@ import java.util.Date; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -//@Builder -//@NoArgsConstructor -//@AllArgsConstructor public class BpmTaskExtDO extends BaseDO { /** * 任务的审批人 * - * 冗余 {@link Task#getAssignee()} + * 冗余 Task 的 assignee 属性 */ private Long assigneeUserId; /** * 任务的名字 * - * 冗余 {@link Task#getName()} 为了筛选 + * 冗余 Task 的 name 属性,为了筛选 */ private String name; /** * 任务的编号 * - * 关联 {@link Task#getId()} + * 关联 Task 的 id 属性 */ private String taskId; // /** @@ -65,20 +58,20 @@ public class BpmTaskExtDO extends BaseDO { /** * 任务的结束时间 * - * 冗余 {@link HistoricTaskInstance#getEndTime()} + * 冗余 HistoricTaskInstance 的 endTime 属性 */ private Date endTime; /** * 流程实例的编号 * - * 关联 {@link ProcessInstance#getId()} + * 关联 ProcessInstance 的 id 属性 */ private String processInstanceId; /** * 流程定义的编号 * - * 关联 {@link ProcessDefinition#getId()} + * 关联 ProcessDefinition 的 id 属性 */ private String processDefinitionId; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java similarity index 91% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java index eeed00bb6..d857e145c 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.definition; +package cn.iocoder.yudao.module.bpm.dal.mysql.definition; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/definition/BpmTaskAssignRuleMapper.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmTaskAssignRuleMapper.java similarity index 95% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/definition/BpmTaskAssignRuleMapper.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmTaskAssignRuleMapper.java index 3879a0f07..1205d30e1 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/definition/BpmTaskAssignRuleMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmTaskAssignRuleMapper.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.definition; +package cn.iocoder.yudao.module.bpm.dal.mysql.definition; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmTaskAssignRuleDO; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/oa/BpmOALeaveMapper.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/BpmOALeaveMapper.java similarity index 87% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/oa/BpmOALeaveMapper.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/BpmOALeaveMapper.java index 4c47ea8bc..a5ae1dec7 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/oa/BpmOALeaveMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/BpmOALeaveMapper.java @@ -1,6 +1,6 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.oa; +package cn.iocoder.yudao.module.bpm.dal.mysql.oa; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.BpmOALeavePageReqVO; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeavePageReqVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java similarity index 90% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java index 8fdc031dd..075cbae9e 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java @@ -1,6 +1,6 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.task; +package cn.iocoder.yudao.module.bpm.dal.mysql.task; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance.BpmProcessInstanceMyPageReqVO; +import cn.iocoder.yudao.module.bpm.controller.task.vo.instance.BpmProcessInstanceMyPageReqVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/task/BpmTaskExtMapper.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmTaskExtMapper.java similarity index 93% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/task/BpmTaskExtMapper.java rename to yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmTaskExtMapper.java index b89f1a245..b2927a65e 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/task/BpmTaskExtMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmTaskExtMapper.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.task; +package cn.iocoder.yudao.module.bpm.dal.mysql.task; import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/enums/message/BpmMessageEnum.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/enums/message/BpmMessageEnum.java index 7462570c2..79001fccd 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/enums/message/BpmMessageEnum.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/enums/message/BpmMessageEnum.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.bpm.enums.message; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; import lombok.AllArgsConstructor; import lombok.Getter; @@ -20,9 +19,8 @@ public enum BpmMessageEnum { /** * 短信模板的标识 * - * 关联 {@link SysSmsTemplateDO#getCode()} + * 关联 SmsTemplateDO 的 code 属性 */ - private final String smsCode; - + private final String smsTemplateCode; } diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupService.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupService.java index 2280d4a46..f61e8f9d5 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupService.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupService.java @@ -46,6 +46,14 @@ public interface BpmUserGroupService { */ BpmUserGroupDO getUserGroup(Long id); + /** + * 获得用户组列表 + * + * @param ids 编号 + * @return 用户组列表 + */ + List getUserGroupList(Collection ids); + /** * 获得指定状态的用户组列表 * @@ -70,4 +78,5 @@ public interface BpmUserGroupService { * @param ids 用户组编号数组 */ void validUserGroups(Set ids); + } diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupServiceImpl.java index 79c5aeab2..6116e8cce 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupServiceImpl.java @@ -15,12 +15,13 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; -import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.USER_GROUP_NOT_EXISTS; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; /** * 用户组 Service 实现类 @@ -71,6 +72,11 @@ public class BpmUserGroupServiceImpl implements BpmUserGroupService { return userGroupMapper.selectById(id); } + @Override + public List getUserGroupList(Collection ids) { + return userGroupMapper.selectBatchIds(ids); + } + @Override public List getUserGroupListByStatus(Integer status) { diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java index c308620f8..61b3c57d4 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java @@ -1,13 +1,13 @@ package cn.iocoder.yudao.module.bpm.service.message; -import cn.iocoder.yudao.adminserver.modules.bpm.enums.message.BpmMessageEnum; -import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService; +import cn.iocoder.yudao.framework.web.config.WebProperties; +import cn.iocoder.yudao.module.bpm.convert.message.BpmMessageConvert; +import cn.iocoder.yudao.module.bpm.enums.message.BpmMessageEnum; import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO; import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO; import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenTaskCreatedReqDTO; -import cn.iocoder.yudao.module.system.service.sms.SysSmsCoreService; +import cn.iocoder.yudao.module.system.api.sms.SmsSendApi; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -26,18 +26,18 @@ import java.util.Map; public class BpmMessageServiceImpl implements BpmMessageService { @Resource - private SysSmsCoreService smsCoreService; + private SmsSendApi smsSendApi; - @Value("${yudao.url.admin-ui}") - private String adminUiUrl; + @Resource + private WebProperties webProperties; @Override public void sendMessageWhenProcessInstanceApprove(BpmMessageSendWhenProcessInstanceApproveReqDTO reqDTO) { Map templateParams = new HashMap<>(); templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); - smsCoreService.sendSingleSmsToAdmin(null, reqDTO.getStartUserId(), - BpmMessageEnum.PROCESS_INSTANCE_APPROVE.getSmsCode(), templateParams); + smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(), + BpmMessageEnum.PROCESS_INSTANCE_APPROVE.getSmsTemplateCode(), templateParams)); } @Override @@ -46,8 +46,8 @@ public class BpmMessageServiceImpl implements BpmMessageService { templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); templateParams.put("comment", reqDTO.getComment()); templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); - smsCoreService.sendSingleSmsToAdmin(null, reqDTO.getStartUserId(), - BpmMessageEnum.PROCESS_INSTANCE_REJECT.getSmsCode(), templateParams); + smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(), + BpmMessageEnum.PROCESS_INSTANCE_REJECT.getSmsTemplateCode(), templateParams)); } @Override @@ -57,12 +57,12 @@ public class BpmMessageServiceImpl implements BpmMessageService { templateParams.put("taskName", reqDTO.getTaskName()); templateParams.put("startUserNickname", reqDTO.getStartUserNickname()); templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); - smsCoreService.sendSingleSmsToAdmin(null, reqDTO.getAssigneeUserId(), - BpmMessageEnum.TASK_ASSIGNED.getSmsCode(), templateParams); + smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(), + BpmMessageEnum.TASK_ASSIGNED.getSmsTemplateCode(), templateParams)); } private String getProcessInstanceDetailUrl(String taskId) { - return adminUiUrl + "bpm/process-instance/detail?id=" + taskId; + return webProperties.getAdminUi().getUrl() + "/bpm/process-instance/detail?id=" + taskId; } } diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/message/dto/BpmMessageSendWhenTaskCreatedReqDTO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/message/dto/BpmMessageSendWhenTaskCreatedReqDTO.java index 7f696d1d3..bf9528f66 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/message/dto/BpmMessageSendWhenTaskCreatedReqDTO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/message/dto/BpmMessageSendWhenTaskCreatedReqDTO.java @@ -22,7 +22,7 @@ public class BpmMessageSendWhenTaskCreatedReqDTO { @NotEmpty(message = "流程实例的名字不能为空") private String processInstanceName; @NotEmpty(message = "发起人的用户编号") - private String startUserId; + private Long startUserId; @NotEmpty(message = "发起人的昵称") private String startUserNickname; diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/task/package-info.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/task/package-info.java new file mode 100644 index 000000000..eaa615302 --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/service/task/package-info.java @@ -0,0 +1 @@ +package cn.iocoder.yudao.module.bpm.service.task; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmModelController.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmModelController.java index 973c9bdd8..449363d89 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmModelController.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmModelController.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.definition; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.model.*; import cn.iocoder.yudao.adminserver.modules.bpm.convert.definition.BpmModelConvert; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmModelService; import cn.iocoder.yudao.framework.common.pojo.CommonResult; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/BpmOALeaveController.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/BpmOALeaveController.java index ebf252c1d..47ac08735 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/BpmOALeaveController.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/BpmOALeaveController.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.BpmOALeaveCreateReqVO; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.BpmOALeavePageReqVO; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.BpmOALeaveRespVO; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeaveCreateReqVO; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeavePageReqVO; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeaveRespVO; import cn.iocoder.yudao.adminserver.modules.bpm.convert.oa.BpmOALeaveConvert; import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO; import cn.iocoder.yudao.adminserver.modules.bpm.service.oa.BpmOALeaveService; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmActivityController.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmActivityController.java index b5b7f59d9..be4bc75c3 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmActivityController.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmActivityController.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.task; import cn.hutool.core.util.StrUtil; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.activity.BpmActivityRespVO; +import cn.iocoder.yudao.module.bpm.controller.task.vo.activity.BpmActivityRespVO; import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmActivityService; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmProcessInstanceController.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmProcessInstanceController.java index 4240e39af..f32e3242f 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmProcessInstanceController.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmProcessInstanceController.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.task; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance.*; import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmProcessInstanceService; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.bpm.controller.task.vo.instance.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; @@ -25,7 +25,7 @@ public class BpmProcessInstanceController { @Resource private BpmProcessInstanceService processInstanceService; - + @PostMapping("/create") @ApiOperation("新建流程实例") @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmTaskController.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmTaskController.java index 3ad59a7aa..665b735ae 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmTaskController.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmTaskController.java @@ -1,10 +1,9 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.task; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task.*; import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmTaskService; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; +import cn.iocoder.yudao.module.bpm.controller.task.vo.task.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; @@ -13,9 +12,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import java.io.IOException; import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/definition/BpmModelConvert.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/definition/BpmModelConvert.java index b6327057e..64c57c00b 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/definition/BpmModelConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/definition/BpmModelConvert.java @@ -1,13 +1,12 @@ package cn.iocoder.yudao.adminserver.modules.bpm.convert.definition; import cn.hutool.core.util.StrUtil; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.model.*; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmModelMetaInfoRespDTO; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmProcessDefinitionCreateReqDTO; -import cn.iocoder.yudao.module.bpm.api.form.dto.BpmFormDTO; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.module.bpm.controller.definition.vo.model.*; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; import org.activiti.engine.impl.persistence.entity.SuspensionState; import org.activiti.engine.repository.Deployment; import org.activiti.engine.repository.Model; @@ -31,19 +30,19 @@ public interface BpmModelConvert { BpmModelConvert INSTANCE = Mappers.getMapper(BpmModelConvert.class); - default List convertList(List list, Map formMap, + default List convertList(List list, Map formMap, Map deploymentMap, Map processDefinitionMap) { return CollectionUtils.convertList(list, model -> { BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class); - BpmFormDTO form = metaInfo != null ? formMap.get(metaInfo.getFormId()) : null; + BpmFormDO form = metaInfo != null ? formMap.get(metaInfo.getFormId()) : null; Deployment deployment = model.getDeploymentId() != null ? deploymentMap.get(model.getDeploymentId()) : null; ProcessDefinition processDefinition = model.getDeploymentId() != null ? processDefinitionMap.get(model.getDeploymentId()) : null; return convert(model, form, deployment, processDefinition); }); } - default BpmModelPageItemRespVO convert(Model model, BpmFormDTO form, Deployment deployment, ProcessDefinition processDefinition) { + default BpmModelPageItemRespVO convert(Model model, BpmFormDO form, Deployment deployment, ProcessDefinition processDefinition) { BpmModelPageItemRespVO modelRespVO = new BpmModelPageItemRespVO(); modelRespVO.setId(model.getId()); modelRespVO.setCreateTime(model.getCreateTime()); @@ -84,7 +83,7 @@ public interface BpmModelConvert { void copyTo(BpmModelMetaInfoRespDTO from, @MappingTarget BpmModelBaseVO to); - default BpmProcessDefinitionCreateReqDTO convert2(Model model, BpmFormDTO form) { + default BpmProcessDefinitionCreateReqDTO convert2(Model model, BpmFormDO form) { BpmProcessDefinitionCreateReqDTO createReqDTO = new BpmProcessDefinitionCreateReqDTO(); createReqDTO.setModelId(model.getId()); createReqDTO.setName(model.getName()); diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/definition/BpmProcessDefinitionConvert.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/definition/BpmProcessDefinitionConvert.java index eba3273f1..97354a951 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/definition/BpmProcessDefinitionConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/definition/BpmProcessDefinitionConvert.java @@ -2,9 +2,9 @@ package cn.iocoder.yudao.adminserver.modules.bpm.convert.definition; import cn.iocoder.yudao.module.bpm.controller.definition.vo.process.BpmProcessDefinitionPageItemRespVO; import cn.iocoder.yudao.module.bpm.controller.definition.vo.process.BpmProcessDefinitionRespVO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmProcessDefinitionCreateReqDTO; -import cn.iocoder.yudao.module.bpm.api.form.dto.BpmFormDTO; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import org.activiti.engine.impl.persistence.entity.SuspensionState; import org.activiti.engine.repository.Deployment; @@ -29,17 +29,17 @@ public interface BpmProcessDefinitionConvert { BpmProcessDefinitionConvert INSTANCE = Mappers.getMapper(BpmProcessDefinitionConvert.class); default List convertList(List list, Map deploymentMap, - Map processDefinitionDOMap, Map formMap) { + Map processDefinitionDOMap, Map formMap) { return CollectionUtils.convertList(list, definition -> { Deployment deployment = definition.getDeploymentId() != null ? deploymentMap.get(definition.getDeploymentId()) : null; BpmProcessDefinitionExtDO definitionDO = processDefinitionDOMap.get(definition.getId()); - BpmFormDTO form = definitionDO != null ? formMap.get(definitionDO.getFormId()) : null; + BpmFormDO form = definitionDO != null ? formMap.get(definitionDO.getFormId()) : null; return convert(definition, deployment, definitionDO, form); }); } default BpmProcessDefinitionPageItemRespVO convert(ProcessDefinition bean, Deployment deployment, - BpmProcessDefinitionExtDO processDefinitionExtDO, BpmFormDTO form) { + BpmProcessDefinitionExtDO processDefinitionExtDO, BpmFormDO form) { BpmProcessDefinitionPageItemRespVO respVO = convert(bean); respVO.setSuspensionState(bean.isSuspended() ? SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode()); if (deployment != null) { diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/message/BpmMessageConvert.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/message/BpmMessageConvert.java index ca84b72a9..4ea82abe3 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/message/BpmMessageConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/message/BpmMessageConvert.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.adminserver.modules.bpm.convert.message; import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO; import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO; import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenTaskCreatedReqDTO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import org.activiti.api.task.model.Task; import org.activiti.engine.runtime.ProcessInstance; import org.mapstruct.Mapper; @@ -17,7 +17,7 @@ public interface BpmMessageConvert { BpmMessageConvert INSTANCE = Mappers.getMapper(BpmMessageConvert.class); - default BpmMessageSendWhenTaskCreatedReqDTO convert(ProcessInstance processInstance, SysUserDO startUser, Task task) { + default BpmMessageSendWhenTaskCreatedReqDTO convert(ProcessInstance processInstance, AdminUserRespDTO startUser, Task task) { BpmMessageSendWhenTaskCreatedReqDTO reqDTO = new BpmMessageSendWhenTaskCreatedReqDTO(); copyTo(processInstance, reqDTO); copyTo(startUser, reqDTO); @@ -30,7 +30,7 @@ public interface BpmMessageConvert { @Mapping(source = "id", target = "startUserId"), @Mapping(source = "nickname", target = "startUserNickname") }) - void copyTo(SysUserDO from, @MappingTarget BpmMessageSendWhenTaskCreatedReqDTO to); + void copyTo(AdminUserRespDTO from, @MappingTarget BpmMessageSendWhenTaskCreatedReqDTO to); @Mappings({ @Mapping(source = "id", target = "taskId"), @Mapping(source = "name", target = "taskName"), diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/oa/BpmOALeaveConvert.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/oa/BpmOALeaveConvert.java index 49c5d8bd1..c8af88fc1 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/oa/BpmOALeaveConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/oa/BpmOALeaveConvert.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.adminserver.modules.bpm.convert.oa; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.BpmOALeaveCreateReqVO; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.BpmOALeaveRespVO; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeaveCreateReqVO; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeaveRespVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import org.mapstruct.Mapper; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmActivityConvert.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmActivityConvert.java index a9882f960..8635b330a 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmActivityConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmActivityConvert.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.adminserver.modules.bpm.convert.task; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.activity.BpmActivityRespVO; +import cn.iocoder.yudao.module.bpm.controller.task.vo.activity.BpmActivityRespVO; import org.activiti.engine.history.HistoricActivityInstance; import org.mapstruct.Mapper; import org.mapstruct.Mapping; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmProcessInstanceConvert.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmProcessInstanceConvert.java index 304894e59..459362ce7 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmProcessInstanceConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmProcessInstanceConvert.java @@ -1,12 +1,12 @@ package cn.iocoder.yudao.adminserver.modules.bpm.convert.task; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance.BpmProcessInstancePageItemRespVO; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance.BpmProcessInstanceRespVO; +import cn.iocoder.yudao.module.bpm.controller.task.vo.instance.BpmProcessInstancePageItemRespVO; +import cn.iocoder.yudao.module.bpm.controller.task.vo.instance.BpmProcessInstanceRespVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO; import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.event.BpmProcessInstanceResultEvent; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import org.activiti.engine.history.HistoricProcessInstance; import org.activiti.engine.repository.ProcessDefinition; @@ -71,7 +71,7 @@ public interface BpmProcessInstanceConvert { default BpmProcessInstanceRespVO convert2(HistoricProcessInstance processInstance, BpmProcessInstanceExtDO processInstanceExt, ProcessDefinition processDefinition, BpmProcessDefinitionExtDO processDefinitionExt, - String bpmnXml, SysUserDO startUser, SysDeptDO dept) { + String bpmnXml, AdminUserRespDTO startUser, DeptRespDTO dept) { BpmProcessInstanceRespVO respVO = convert2(processInstance); copyTo(processInstanceExt, respVO); // definition @@ -94,7 +94,7 @@ public interface BpmProcessInstanceConvert { BpmProcessInstanceRespVO.ProcessDefinition convert2(ProcessDefinition bean); @Mapping(source = "from.id", target = "to.id", ignore = true) void copyTo(BpmProcessDefinitionExtDO from, @MappingTarget BpmProcessInstanceRespVO.ProcessDefinition to); - BpmProcessInstanceRespVO.User convert2(SysUserDO bean); + BpmProcessInstanceRespVO.User convert2(AdminUserRespDTO bean); default BpmProcessInstanceResultEvent convert(Object source, ProcessInstance instance, Integer result) { BpmProcessInstanceResultEvent event = new BpmProcessInstanceResultEvent(source); diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmTaskConvert.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmTaskConvert.java index 4e092f850..e9689d6fd 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmTaskConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/task/BpmTaskConvert.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.adminserver.modules.bpm.convert.task; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task.BpmTaskDonePageItemRespVO; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task.BpmTaskRespVO; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task.BpmTaskTodoPageItemRespVO; +import cn.iocoder.yudao.module.bpm.controller.task.vo.task.BpmTaskDonePageItemRespVO; +import cn.iocoder.yudao.module.bpm.controller.task.vo.task.BpmTaskRespVO; +import cn.iocoder.yudao.module.bpm.controller.task.vo.task.BpmTaskTodoPageItemRespVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.number.NumberUtils; import org.activiti.engine.history.HistoricProcessInstance; @@ -30,12 +30,12 @@ public interface BpmTaskConvert { BpmTaskConvert INSTANCE = Mappers.getMapper(BpmTaskConvert.class); default List convertList1(List tasks, Map processInstanceMap, - Map userMap) { + Map userMap) { return CollectionUtils.convertList(tasks, task -> { BpmTaskTodoPageItemRespVO respVO = convert1(task); ProcessInstance processInstance = processInstanceMap.get(task.getProcessInstanceId()); if (processInstance != null) { - SysUserDO startUser = userMap.get(NumberUtils.parseLong(processInstance.getStartUserId())); + AdminUserRespDTO startUser = userMap.get(NumberUtils.parseLong(processInstance.getStartUserId())); respVO.setProcessInstance(convert(processInstance, startUser)); } return respVO; @@ -53,14 +53,14 @@ public interface BpmTaskConvert { default List convertList2(List tasks, Map bpmTaskExtDOMap, Map historicProcessInstanceMap, - Map userMap) { + Map userMap) { return CollectionUtils.convertList(tasks, task -> { BpmTaskDonePageItemRespVO respVO = convert2(task); BpmTaskExtDO taskExtDO = bpmTaskExtDOMap.get(task.getId()); copyTo(taskExtDO, respVO); HistoricProcessInstance processInstance = historicProcessInstanceMap.get(task.getProcessInstanceId()); if (processInstance != null) { - SysUserDO startUser = userMap.get(NumberUtils.parseLong(processInstance.getStartUserId())); + AdminUserRespDTO startUser = userMap.get(NumberUtils.parseLong(processInstance.getStartUserId())); respVO.setProcessInstance(convert(processInstance, startUser)); } return respVO; @@ -77,20 +77,20 @@ public interface BpmTaskConvert { BpmTaskExtDO convert(org.activiti.api.task.model.Task bean); default List convertList3(List tasks, Map bpmTaskExtDOMap, - HistoricProcessInstance processInstance, Map userMap, - Map deptMap) { + HistoricProcessInstance processInstance, Map userMap, + Map deptMap) { return CollectionUtils.convertList(tasks, task -> { BpmTaskRespVO respVO = convert3(task); BpmTaskExtDO taskExtDO = bpmTaskExtDOMap.get(task.getId()); copyTo(taskExtDO, respVO); if (processInstance != null) { - SysUserDO startUser = userMap.get(NumberUtils.parseLong(processInstance.getStartUserId())); + AdminUserRespDTO startUser = userMap.get(NumberUtils.parseLong(processInstance.getStartUserId())); respVO.setProcessInstance(convert(processInstance, startUser)); } - SysUserDO assignUser = userMap.get(NumberUtils.parseLong(task.getAssignee())); + AdminUserRespDTO assignUser = userMap.get(NumberUtils.parseLong(task.getAssignee())); if (assignUser != null) { respVO.setAssigneeUser(convert3(assignUser)); - SysDeptDO dept = deptMap.get(assignUser.getDeptId()); + DeptRespDTO dept = deptMap.get(assignUser.getDeptId()); if (dept != null) { respVO.getAssigneeUser().setDeptName(dept.getName()); } @@ -101,7 +101,7 @@ public interface BpmTaskConvert { @Mapping(source = "taskDefinitionKey", target = "definitionKey") BpmTaskRespVO convert3(HistoricTaskInstance bean); - BpmTaskRespVO.User convert3(SysUserDO bean); + BpmTaskRespVO.User convert3(AdminUserRespDTO bean); void copyTo(BpmTaskExtDO from, @MappingTarget BpmTaskDonePageItemRespVO to); @@ -112,7 +112,7 @@ public interface BpmTaskConvert { @Mapping(source = "processInstance.processDefinitionId", target = "processDefinitionId"), @Mapping(source = "startUser.nickname", target = "startUserNickname") }) - BpmTaskTodoPageItemRespVO.ProcessInstance convert(ProcessInstance processInstance, SysUserDO startUser); + BpmTaskTodoPageItemRespVO.ProcessInstance convert(ProcessInstance processInstance, AdminUserRespDTO startUser); @Mappings({ @Mapping(source = "processInstance.id", target = "id"), @@ -121,6 +121,6 @@ public interface BpmTaskConvert { @Mapping(source = "processInstance.processDefinitionId", target = "processDefinitionId"), @Mapping(source = "startUser.nickname", target = "startUserNickname") }) - BpmTaskTodoPageItemRespVO.ProcessInstance convert(HistoricProcessInstance processInstance, SysUserDO startUser); + BpmTaskTodoPageItemRespVO.ProcessInstance convert(HistoricProcessInstance processInstance, AdminUserRespDTO startUser); } diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/config/BpmActivitiConfiguration.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/config/BpmActivitiConfiguration.java index 280221153..18f867ffa 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/config/BpmActivitiConfiguration.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/config/BpmActivitiConfiguration.java @@ -6,13 +6,10 @@ import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.event.Bp import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.identity.EmptyUserGroupManager; import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.listener.BpmTackActivitiEventListener; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmTaskAssignRuleService; -import cn.iocoder.yudao.module.bpm.api.group.BpmUserGroupServiceApi; -import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.module.system.service.permission.SysPermissionCoreService; -import cn.iocoder.yudao.module.system.service.user.SysUserCoreService; -import cn.iocoder.yudao.coreservice.modules.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.coreservice.modules.system.service.permission.SysPermissionCoreService; -import cn.iocoder.yudao.coreservice.modules.system.service.user.SysUserCoreService; +import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.permission.PermissionApi; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; import org.activiti.api.runtime.shared.identity.UserGroupManager; import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer; import org.springframework.context.ApplicationEventPublisher; @@ -67,17 +64,17 @@ public class BpmActivitiConfiguration { @Bean public BpmActivityBehaviorFactory bpmActivityBehaviorFactory(BpmTaskAssignRuleService taskRuleService, - SysPermissionCoreService permissionCoreService, - SysDeptCoreService deptCoreService, - BpmUserGroupServiceApi userGroupServiceApi, - SysUserCoreService userCoreService, + BpmUserGroupService userGroupService, + PermissionApi permissionApi, + DeptApi deptApi, + AdminUserApi adminUserApi, List scripts) { BpmActivityBehaviorFactory bpmActivityBehaviorFactory = new BpmActivityBehaviorFactory(); bpmActivityBehaviorFactory.setBpmTaskRuleService(taskRuleService); - bpmActivityBehaviorFactory.setPermissionCoreService(permissionCoreService); - bpmActivityBehaviorFactory.setDeptCoreService(deptCoreService); - bpmActivityBehaviorFactory.setUserGroupServiceApi(userGroupServiceApi); - bpmActivityBehaviorFactory.setUserCoreService(userCoreService); + bpmActivityBehaviorFactory.setUserGroupService(userGroupService); + bpmActivityBehaviorFactory.setAdminUserApi(adminUserApi); + bpmActivityBehaviorFactory.setPermissionApi(permissionApi); + bpmActivityBehaviorFactory.setDeptApi(deptApi); bpmActivityBehaviorFactory.setScripts(scripts); return bpmActivityBehaviorFactory; } diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmActivityBehaviorFactory.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmActivityBehaviorFactory.java index d401cfacc..aa38a24c0 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmActivityBehaviorFactory.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmActivityBehaviorFactory.java @@ -2,10 +2,10 @@ package cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.behavio import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.behavior.script.BpmTaskAssignScript; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmTaskAssignRuleService; -import cn.iocoder.yudao.module.bpm.api.group.BpmUserGroupServiceApi; -import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.module.system.service.permission.SysPermissionCoreService; -import cn.iocoder.yudao.module.system.service.user.SysUserCoreService; +import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.permission.PermissionApi; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Setter; @@ -30,13 +30,15 @@ public class BpmActivityBehaviorFactory extends DefaultActivityBehaviorFactory { @Setter private BpmTaskAssignRuleService bpmTaskRuleService; @Setter - private SysPermissionCoreService permissionCoreService; + private BpmUserGroupService userGroupService; + @Setter - private SysDeptCoreService deptCoreService; + private PermissionApi permissionApi; @Setter - private BpmUserGroupServiceApi userGroupServiceApi; + private DeptApi deptApi; @Setter - private SysUserCoreService userCoreService; + private AdminUserApi adminUserApi; + @Setter private List scripts; @@ -44,10 +46,10 @@ public class BpmActivityBehaviorFactory extends DefaultActivityBehaviorFactory { public UserTaskActivityBehavior createUserTaskActivityBehavior(UserTask userTask) { BpmUserTaskActivitiBehavior userTaskActivityBehavior = new BpmUserTaskActivitiBehavior(userTask); userTaskActivityBehavior.setBpmTaskRuleService(bpmTaskRuleService); - userTaskActivityBehavior.setPermissionCoreService(permissionCoreService); - userTaskActivityBehavior.setDeptCoreService(deptCoreService); - userTaskActivityBehavior.setUserGroupServiceApi(userGroupServiceApi); - userTaskActivityBehavior.setSysUserCoreService(userCoreService); + userTaskActivityBehavior.setPermissionApi(permissionApi); + userTaskActivityBehavior.setDeptApi(deptApi); + userTaskActivityBehavior.setUserGroupService(userGroupService); + userTaskActivityBehavior.setAdminUserApi(adminUserApi); userTaskActivityBehavior.setScripts(scripts); return userTaskActivityBehavior; } diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmUserTaskActivitiBehavior.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmUserTaskActivitiBehavior.java index 70d130502..a540d1ffa 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmUserTaskActivitiBehavior.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmUserTaskActivitiBehavior.java @@ -3,18 +3,18 @@ package cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.behavio import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.StrUtil; -import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmTaskAssignRuleDO; -import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum; import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.behavior.script.BpmTaskAssignScript; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmTaskAssignRuleService; -import cn.iocoder.yudao.module.bpm.api.group.BpmUserGroupServiceApi; -import cn.iocoder.yudao.module.bpm.api.group.dto.BpmUserGroupDTO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; -import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.module.system.service.permission.SysPermissionCoreService; -import cn.iocoder.yudao.module.system.service.user.SysUserCoreService; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmTaskAssignRuleDO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO; +import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum; +import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; +import cn.iocoder.yudao.module.system.api.permission.PermissionApi; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import com.google.common.annotations.VisibleForTesting; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -28,12 +28,12 @@ import org.activiti.engine.impl.persistence.entity.TaskEntityManager; import java.util.*; -import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.TASK_ASSIGN_SCRIPT_NOT_EXISTS; -import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.TASK_CREATE_FAIL_NO_CANDIDATE_USER; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.TASK_ASSIGN_SCRIPT_NOT_EXISTS; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.TASK_CREATE_FAIL_NO_CANDIDATE_USER; /** * 自定义的流程任务的 assignee 负责人的分配 @@ -48,14 +48,17 @@ public class BpmUserTaskActivitiBehavior extends UserTaskActivityBehavior { @Setter private BpmTaskAssignRuleService bpmTaskRuleService; + @Setter - private SysPermissionCoreService permissionCoreService; + private BpmUserGroupService userGroupService; + @Setter - private SysDeptCoreService deptCoreService; + private DeptApi deptApi; @Setter - private BpmUserGroupServiceApi userGroupServiceApi; + private AdminUserApi adminUserApi; @Setter - private SysUserCoreService sysUserCoreService; + private PermissionApi permissionApi; + /** * 任务分配脚本 */ @@ -133,22 +136,22 @@ public class BpmUserTaskActivitiBehavior extends UserTaskActivityBehavior { } private Set calculateTaskCandidateUsersByRole(TaskEntity task, BpmTaskAssignRuleDO rule) { - return permissionCoreService.getUserRoleIdListByRoleIds(rule.getOptions()); + return permissionApi.getUserRoleIdListByRoleIds(rule.getOptions()); } private Set calculateTaskCandidateUsersByDeptMember(TaskEntity task, BpmTaskAssignRuleDO rule) { - List users = sysUserCoreService.getUsersByDeptIds(rule.getOptions()); - return convertSet(users, SysUserDO::getId); + List users = adminUserApi.getUsersByDeptIds(rule.getOptions()); + return convertSet(users, AdminUserRespDTO::getId); } private Set calculateTaskCandidateUsersByDeptLeader(TaskEntity task, BpmTaskAssignRuleDO rule) { - List depts = deptCoreService.getDepts(rule.getOptions()); - return convertSet(depts, SysDeptDO::getLeaderUserId); + List depts = deptApi.getDepts(rule.getOptions()); + return convertSet(depts, DeptRespDTO::getLeaderUserId); } private Set calculateTaskCandidateUsersByPost(TaskEntity task, BpmTaskAssignRuleDO rule) { - List users = sysUserCoreService.getUsersByPostIds(rule.getOptions()); - return convertSet(users, SysUserDO::getId); + List users = adminUserApi.getUsersByPostIds(rule.getOptions()); + return convertSet(users, AdminUserRespDTO::getId); } private Set calculateTaskCandidateUsersByUser(TaskEntity task, BpmTaskAssignRuleDO rule) { @@ -156,9 +159,9 @@ public class BpmUserTaskActivitiBehavior extends UserTaskActivityBehavior { } private Set calculateTaskCandidateUsersByUserGroup(TaskEntity task, BpmTaskAssignRuleDO rule) { - List userGroups = userGroupServiceApi.getUserGroupList(rule.getOptions()); + List userGroups = userGroupService.getUserGroupList(rule.getOptions()); Set userIds = new HashSet<>(); - userGroups.forEach(bpmUserGroupDO -> userIds.addAll(bpmUserGroupDO.getMemberUserIds())); + userGroups.forEach(group -> userIds.addAll(group.getMemberUserIds())); return userIds; } @@ -183,9 +186,9 @@ public class BpmUserTaskActivitiBehavior extends UserTaskActivityBehavior { if (CollUtil.isEmpty(assigneeUserIds)) { return; } - Map userMap = sysUserCoreService.getUserMap(assigneeUserIds); + Map userMap = adminUserApi.getUserMap(assigneeUserIds); assigneeUserIds.removeIf(id -> { - SysUserDO user = userMap.get(id); + AdminUserRespDTO user = userMap.get(id); return user == null || !CommonStatusEnum.ENABLE.getStatus().equals(user.getStatus()); }); } diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/script/impl/BpmTaskAssignLeaderAbstractScript.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/script/impl/BpmTaskAssignLeaderAbstractScript.java index 465be3b4a..e84c5df17 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/script/impl/BpmTaskAssignLeaderAbstractScript.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/script/impl/BpmTaskAssignLeaderAbstractScript.java @@ -2,16 +2,17 @@ package cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.behavio import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.behavior.script.BpmTaskAssignScript; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; -import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.module.system.service.user.SysUserCoreService; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import org.activiti.engine.impl.persistence.entity.TaskEntity; import org.springframework.util.Assert; import javax.annotation.Resource; import java.util.Set; +import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; import static java.util.Collections.emptySet; /** @@ -23,16 +24,16 @@ import static java.util.Collections.emptySet; public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssignScript { @Resource - private SysUserCoreService userCoreService; + private AdminUserApi adminUserApi; @Resource - private SysDeptCoreService deptCoreService; + private DeptApi deptApi; protected Set calculateTaskCandidateUsers(TaskEntity task, int level) { Assert.isTrue(level > 0, "level 必须大于 0"); // 获得发起人 Long startUserId = Long.parseLong(task.getProcessInstance().getStartUserId()); // 获得对应 leve 的部门 - SysDeptDO dept = null; + DeptRespDTO dept = null; for (int i = 0; i < level; i++) { // 获得 level 对应的部门 if (dept == null) { @@ -41,7 +42,7 @@ public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssign return emptySet(); } } else { - SysDeptDO parentDept = deptCoreService.getDept(dept.getParentId()); + DeptRespDTO parentDept = deptApi.getDept(dept.getParentId()); if (parentDept == null) { // 找不到父级部门,所以只好结束寻找。原因是:例如说,级别比较高的人,所在部门层级比较少 break; } @@ -51,12 +52,12 @@ public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssign return dept.getLeaderUserId() != null ? asSet(dept.getLeaderUserId()) : emptySet(); } - private SysDeptDO getStartUserDept(Long startUserId) { - SysUserDO startUser = userCoreService.getUser(startUserId); + private DeptRespDTO getStartUserDept(Long startUserId) { + AdminUserRespDTO startUser = adminUserApi.getUser(startUserId); if (startUser.getDeptId() == null) { // 找不到部门,所以无法使用该规则 return null; } - return deptCoreService.getDept(startUser.getDeptId()); + return deptApi.getDept(startUser.getDeptId()); } } diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmModelServiceImpl.java similarity index 93% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java rename to yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmModelServiceImpl.java index e70fae67c..0f37fb582 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmModelServiceImpl.java @@ -1,26 +1,22 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.service.definition.impl; +package cn.iocoder.yudao.adminserver.modules.bpm.service.definition; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.StrUtil; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.model.*; -import cn.iocoder.yudao.module.bpm.controller.definition.vo.model.*; -import cn.iocoder.yudao.module.bpm.controller.definition.vo.rule.BpmTaskAssignRuleRespVO; import cn.iocoder.yudao.adminserver.modules.bpm.convert.definition.BpmModelConvert; -import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum; -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmModelService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmTaskAssignRuleService; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmModelMetaInfoRespDTO; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmProcessDefinitionCreateReqDTO; -import cn.iocoder.yudao.module.bpm.api.form.BpmFormServiceApi; -import cn.iocoder.yudao.module.bpm.api.form.dto.BpmFormDTO; import cn.iocoder.yudao.framework.activiti.core.util.ActivitiUtils; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.common.util.object.PageUtils; import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; +import cn.iocoder.yudao.module.bpm.controller.definition.vo.model.*; +import cn.iocoder.yudao.module.bpm.controller.definition.vo.rule.BpmTaskAssignRuleRespVO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; +import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum; +import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService; import lombok.extern.slf4j.Slf4j; import org.activiti.bpmn.model.BpmnModel; import org.activiti.engine.RepositoryService; @@ -38,9 +34,9 @@ import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; import java.util.*; -import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; /** * 流程定义实现 @@ -57,7 +53,7 @@ public class BpmModelServiceImpl implements BpmModelService { @Resource private RepositoryService repositoryService; @Resource - private BpmFormServiceApi formServiceApi; + private BpmFormService bpmFormService; @Resource private BpmProcessDefinitionService processDefinitionService; @Resource @@ -85,7 +81,7 @@ public class BpmModelServiceImpl implements BpmModelService { BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class); return metaInfo != null ? metaInfo.getFormId() : null; }); - Map formMap = formServiceApi.getFormMap(formIds); + Map formMap = bpmFormService.getFormMap(formIds); // 获得 Deployment Map Set deploymentIds = new HashSet<>(); @@ -172,7 +168,7 @@ public class BpmModelServiceImpl implements BpmModelService { } // TODO 芋艿:校验流程图的有效性;例如说,是否有开始的元素,是否有结束的元素; // 校验表单已配 - BpmFormDTO form = checkFormConfig(model); + BpmFormDO form = checkFormConfig(model); // 校验任务分配规则已配置 checkTaskAssignRuleAllConfig(id); @@ -225,14 +221,14 @@ public class BpmModelServiceImpl implements BpmModelService { * @param model 流程模型 * @return 流程表单 */ - private BpmFormDTO checkFormConfig(Model model) { + private BpmFormDO checkFormConfig(Model model) { BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class); if (metaInfo == null || metaInfo.getFormType() == null) { throw exception(MODEL_DEPLOY_FAIL_FORM_NOT_CONFIG); } // 校验表单存在 if (Objects.equals(metaInfo.getFormType(), BpmModelFormTypeEnum.NORMAL.getType())) { - BpmFormDTO form = formServiceApi.getForm(metaInfo.getFormId()); + BpmFormDO form = bpmFormService.getForm(metaInfo.getFormId()); if (form == null) { throw exception(FORM_NOT_EXISTS); } diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmProcessDefinitionServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmProcessDefinitionServiceImpl.java similarity index 96% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmProcessDefinitionServiceImpl.java rename to yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmProcessDefinitionServiceImpl.java index 67dc6e168..16a968978 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmProcessDefinitionServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmProcessDefinitionServiceImpl.java @@ -1,22 +1,21 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.service.definition.impl; +package cn.iocoder.yudao.adminserver.modules.bpm.service.definition; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.iocoder.yudao.adminserver.modules.bpm.convert.definition.BpmProcessDefinitionConvert; +import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmProcessDefinitionCreateReqDTO; +import cn.iocoder.yudao.framework.activiti.core.util.ActivitiUtils; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.PageUtils; import cn.iocoder.yudao.module.bpm.controller.definition.vo.process.BpmProcessDefinitionListReqVO; import cn.iocoder.yudao.module.bpm.controller.definition.vo.process.BpmProcessDefinitionPageItemRespVO; import cn.iocoder.yudao.module.bpm.controller.definition.vo.process.BpmProcessDefinitionPageReqVO; import cn.iocoder.yudao.module.bpm.controller.definition.vo.process.BpmProcessDefinitionRespVO; -import cn.iocoder.yudao.adminserver.modules.bpm.convert.definition.BpmProcessDefinitionConvert; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; -import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.definition.BpmProcessDefinitionExtMapper; -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmProcessDefinitionCreateReqDTO; -import cn.iocoder.yudao.module.bpm.api.form.BpmFormServiceApi; -import cn.iocoder.yudao.module.bpm.api.form.dto.BpmFormDTO; -import cn.iocoder.yudao.framework.activiti.core.util.ActivitiUtils; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.object.PageUtils; +import cn.iocoder.yudao.module.bpm.dal.mysql.definition.BpmProcessDefinitionExtMapper; +import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService; import lombok.extern.slf4j.Slf4j; import org.activiti.bpmn.model.BpmnModel; import org.activiti.engine.RepositoryService; @@ -31,10 +30,10 @@ import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; import java.util.*; -import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.PROCESS_DEFINITION_KEY_NOT_MATCH; -import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.PROCESS_DEFINITION_NAME_NOT_MATCH; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.PROCESS_DEFINITION_KEY_NOT_MATCH; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.PROCESS_DEFINITION_NAME_NOT_MATCH; import static java.util.Collections.emptyList; /** @@ -55,7 +54,7 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ @Resource private RepositoryService repositoryService; @Resource - private BpmFormServiceApi bpmFormServiceApi; + private BpmFormService formService; @Resource private BpmProcessDefinitionExtMapper processDefinitionMapper; @@ -86,7 +85,7 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ // 获得 Form Map Set formIds = convertSet(processDefinitionDOs, BpmProcessDefinitionExtDO::getFormId); - Map formMap = bpmFormServiceApi.getFormMap(formIds); + Map formMap = formService.getFormMap(formIds); // 拼接结果 long definitionCount = definitionQuery.count(); diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmTaskAssignRuleServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmTaskAssignRuleServiceImpl.java similarity index 83% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmTaskAssignRuleServiceImpl.java rename to yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmTaskAssignRuleServiceImpl.java index b58ab0cb9..1e80f854e 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmTaskAssignRuleServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmTaskAssignRuleServiceImpl.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.service.definition.impl; +package cn.iocoder.yudao.adminserver.modules.bpm.service.definition; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; @@ -8,21 +8,18 @@ import cn.iocoder.yudao.module.bpm.controller.definition.vo.rule.BpmTaskAssignRu import cn.iocoder.yudao.module.bpm.controller.definition.vo.rule.BpmTaskAssignRuleUpdateReqVO; import cn.iocoder.yudao.adminserver.modules.bpm.convert.definition.BpmTaskAssignRuleConvert; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmTaskAssignRuleDO; -import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.definition.BpmTaskAssignRuleMapper; +import cn.iocoder.yudao.module.bpm.dal.mysql.definition.BpmTaskAssignRuleMapper; import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum; -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmModelService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmTaskAssignRuleService; -import cn.iocoder.yudao.module.bpm.api.group.BpmUserGroupServiceApi; -import cn.iocoder.yudao.module.system.enums.SysDictTypeConstants; -import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.module.system.service.dept.SysPostCoreService; -import cn.iocoder.yudao.module.system.service.dict.DictDataCoreService; -import cn.iocoder.yudao.module.system.service.permission.SysRoleCoreService; -import cn.iocoder.yudao.module.system.service.user.SysUserCoreService; import cn.iocoder.yudao.framework.activiti.core.util.ActivitiUtils; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; +import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.PostApi; +import cn.iocoder.yudao.module.system.api.dict.DictDataApi; +import cn.iocoder.yudao.module.system.api.permission.RoleApi; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.enums.DictTypeConstants; import lombok.extern.slf4j.Slf4j; import org.activiti.bpmn.model.BpmnModel; import org.activiti.bpmn.model.UserTask; @@ -34,6 +31,7 @@ import javax.annotation.Resource; import java.util.*; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; /** * BPM 任务分配规则 Service 实现类 @@ -53,17 +51,17 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService { @Lazy // 解决循环依赖 private BpmProcessDefinitionService processDefinitionService; @Resource - private SysRoleCoreService roleCoreService; + private BpmUserGroupService userGroupService; @Resource - private SysDeptCoreService deptCoreService; + private RoleApi roleApi; @Resource - private SysPostCoreService postService; + private DeptApi deptApi; @Resource - private SysUserCoreService userCoreService; + private PostApi postApi; @Resource - private BpmUserGroupServiceApi userGroupServiceApi; + private AdminUserApi adminUserApi; @Resource - private DictDataCoreService dictDataCoreService; + private DictDataApi dictDataApi; @Override public List getTaskAssignRuleListByProcessDefinitionId(String processDefinitionId, @@ -178,18 +176,18 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService { private void validTaskAssignRuleOptions(Integer type, Set options) { if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.ROLE.getType())) { - roleCoreService.validRoles(options); + roleApi.validRoles(options); } else if (ObjectUtils.equalsAny(type, BpmTaskAssignRuleTypeEnum.DEPT_MEMBER.getType(), BpmTaskAssignRuleTypeEnum.DEPT_LEADER.getType())) { - deptCoreService.validDepts(options); + deptApi.validDepts(options); } else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.POST.getType())) { - postService.validPosts(options); + postApi.validPosts(options); } else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.USER.getType())) { - userCoreService.validUsers(options); + adminUserApi.validUsers(options); } else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.USER_GROUP.getType())) { - userGroupServiceApi.validUserGroups(options); + userGroupService.validUserGroups(options); } else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.SCRIPT.getType())) { - dictDataCoreService.validDictDatas(SysDictTypeConstants.BPM_TASK_ASSIGN_SCRIPT, + dictDataApi.validDictDatas(DictTypeConstants.BPM_TASK_ASSIGN_SCRIPT, CollectionUtils.convertSet(options, String::valueOf)); } else { throw new IllegalArgumentException(StrUtil.format("未知的规则类型({})", type)); diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveService.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveService.java index bb4e0de8b..c612b8193 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveService.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveService.java @@ -1,7 +1,8 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.oa; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.*; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeaveCreateReqVO; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeavePageReqVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/impl/BpmOALeaveServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveServiceImpl.java similarity index 89% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/impl/BpmOALeaveServiceImpl.java rename to yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveServiceImpl.java index 31e881242..ab9dcec42 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/impl/BpmOALeaveServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveServiceImpl.java @@ -1,12 +1,12 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.service.oa.impl; +package cn.iocoder.yudao.adminserver.modules.bpm.service.oa; import cn.hutool.core.date.DateUtil; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.*; import cn.iocoder.yudao.adminserver.modules.bpm.convert.oa.BpmOALeaveConvert; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeaveCreateReqVO; +import cn.iocoder.yudao.module.bpm.controller.oa.vo.BpmOALeavePageReqVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO; -import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.oa.BpmOALeaveMapper; +import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOALeaveMapper; import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; -import cn.iocoder.yudao.adminserver.modules.bpm.service.oa.BpmOALeaveService; import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmProcessInstanceService; import cn.iocoder.yudao.adminserver.modules.bpm.service.task.dto.BpmProcessInstanceCreateReqDTO; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -18,6 +18,7 @@ import javax.annotation.Resource; import java.util.*; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; /** * OA 请假申请 Service 实现类 diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/listener/BpmOALeaveResultListener.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/listener/BpmOALeaveResultListener.java index fcc716db9..bd80d51dd 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/listener/BpmOALeaveResultListener.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/listener/BpmOALeaveResultListener.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.oa.listener; import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.event.BpmProcessInstanceResultEvent; import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.event.BpmProcessInstanceResultEventListener; import cn.iocoder.yudao.adminserver.modules.bpm.service.oa.BpmOALeaveService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.oa.impl.BpmOALeaveServiceImpl; +import cn.iocoder.yudao.adminserver.modules.bpm.service.oa.BpmOALeaveServiceImpl; import org.springframework.stereotype.Component; import javax.annotation.Resource; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmActivityService.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmActivityService.java index 8fb15f5ba..badba2b9c 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmActivityService.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmActivityService.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.task; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.activity.BpmActivityRespVO; +import cn.iocoder.yudao.module.bpm.controller.task.vo.activity.BpmActivityRespVO; import java.util.List; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmActivityServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmActivityServiceImpl.java similarity index 86% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmActivityServiceImpl.java rename to yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmActivityServiceImpl.java index 34f7604c0..f60351bd2 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmActivityServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmActivityServiceImpl.java @@ -1,13 +1,10 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.service.task.impl; +package cn.iocoder.yudao.adminserver.modules.bpm.service.task; import cn.hutool.core.io.IoUtil; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.activity.BpmActivityRespVO; import cn.iocoder.yudao.adminserver.modules.bpm.convert.task.BpmActivityConvert; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmActivityService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmProcessInstanceService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmTaskService; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; +import cn.iocoder.yudao.module.bpm.controller.task.vo.activity.BpmActivityRespVO; import lombok.extern.slf4j.Slf4j; import org.activiti.bpmn.model.BpmnModel; import org.activiti.engine.HistoryService; @@ -24,7 +21,7 @@ import java.util.Collections; import java.util.List; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; /** * BPM 活动实例 Service 实现类 diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceService.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceService.java index 1fc2bffc1..1942b13a0 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceService.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceService.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.task; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance.*; +import cn.iocoder.yudao.module.bpm.controller.task.vo.instance.*; import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceDeleteReasonEnum; import cn.iocoder.yudao.adminserver.modules.bpm.service.task.dto.BpmProcessInstanceCreateReqDTO; import cn.iocoder.yudao.framework.common.pojo.PageResult; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmProcessInstanceServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceServiceImpl.java similarity index 93% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmProcessInstanceServiceImpl.java rename to yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceServiceImpl.java index 8aa06f350..caf7fe14e 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmProcessInstanceServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceServiceImpl.java @@ -1,29 +1,27 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.service.task.impl; +package cn.iocoder.yudao.adminserver.modules.bpm.service.task; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance.*; import cn.iocoder.yudao.adminserver.modules.bpm.convert.message.BpmMessageConvert; import cn.iocoder.yudao.adminserver.modules.bpm.convert.task.BpmProcessInstanceConvert; +import cn.iocoder.yudao.module.bpm.controller.task.vo.instance.*; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO; -import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.task.BpmProcessInstanceExtMapper; +import cn.iocoder.yudao.module.bpm.dal.mysql.task.BpmProcessInstanceExtMapper; import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceDeleteReasonEnum; import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceStatusEnum; import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.event.BpmProcessInstanceResultEventPublisher; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmProcessInstanceService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmTaskService; import cn.iocoder.yudao.adminserver.modules.bpm.service.task.dto.BpmProcessInstanceCreateReqDTO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; -import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.module.system.service.user.SysUserCoreService; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.number.NumberUtils; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import lombok.extern.slf4j.Slf4j; import org.activiti.engine.HistoryService; import org.activiti.engine.RuntimeService; @@ -41,6 +39,7 @@ import java.util.*; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; /** * 流程实例 Service 实现类 @@ -65,9 +64,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService private HistoryService historyService; @Resource - private SysUserCoreService userCoreService; + private AdminUserApi adminUserApi; @Resource - private SysDeptCoreService deptCoreService; + private DeptApi deptApi; @Resource @Lazy // 解决循环依赖 private BpmTaskService taskService; @@ -189,10 +188,10 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService String bpmnXml = processDefinitionService.getProcessDefinitionBpmnXML(processInstance.getProcessDefinitionId()); // 获得 User - SysUserDO startUser = userCoreService.getUser(NumberUtils.parseLong(processInstance.getStartUserId())); - SysDeptDO dept = null; + AdminUserRespDTO startUser = adminUserApi.getUser(NumberUtils.parseLong(processInstance.getStartUserId())); + DeptRespDTO dept = null; if (startUser != null) { - dept = deptCoreService.getDept(startUser.getDeptId()); + dept = deptApi.getDept(startUser.getDeptId()); } // 拼接结果 diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskService.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskService.java index b6162dbd8..796106a58 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskService.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskService.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.task; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task.*; +import cn.iocoder.yudao.module.bpm.controller.task.vo.task.*; import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskServiceImpl.java similarity index 91% rename from yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java rename to yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskServiceImpl.java index b694b25aa..0fc5385a0 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskServiceImpl.java @@ -1,25 +1,23 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.service.task.impl; +package cn.iocoder.yudao.adminserver.modules.bpm.service.task; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task.*; import cn.iocoder.yudao.adminserver.modules.bpm.convert.message.BpmMessageConvert; import cn.iocoder.yudao.adminserver.modules.bpm.convert.task.BpmTaskConvert; +import cn.iocoder.yudao.module.bpm.controller.task.vo.task.*; import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO; -import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.task.BpmTaskExtMapper; +import cn.iocoder.yudao.module.bpm.dal.mysql.task.BpmTaskExtMapper; import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmProcessInstanceService; -import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmTaskService; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; -import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.module.system.service.user.SysUserCoreService; import cn.iocoder.yudao.framework.activiti.core.util.ActivitiUtils; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.number.NumberUtils; import cn.iocoder.yudao.framework.common.util.object.PageUtils; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import lombok.extern.slf4j.Slf4j; import org.activiti.engine.HistoryService; import org.activiti.engine.TaskService; @@ -42,6 +40,7 @@ import java.util.*; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; /** * 流程任务实例 Service 实现类 @@ -59,9 +58,9 @@ public class BpmTaskServiceImpl implements BpmTaskService { private HistoryService historyService; @Resource - private SysUserCoreService userCoreService; + private AdminUserApi adminUserApi; @Resource - private SysDeptCoreService deptCoreService; + private DeptApi deptApi; @Resource @Lazy // 解决循环依赖 private BpmProcessInstanceService processInstanceService; @@ -95,9 +94,9 @@ public class BpmTaskServiceImpl implements BpmTaskService { // 获得 User Map Set userIds = convertSet(tasks, task -> NumberUtils.parseLong(task.getAssignee())); userIds.add(NumberUtils.parseLong(processInstance.getStartUserId())); - Map userMap = userCoreService.getUserMap(userIds); + Map userMap = adminUserApi.getUserMap(userIds); // 获得 Dept Map - Map deptMap = deptCoreService.getDeptMap(convertSet(userMap.values(), SysUserDO::getDeptId)); + Map deptMap = deptApi.getDeptMap(convertSet(userMap.values(), AdminUserRespDTO::getDeptId)); // 拼接数据 return BpmTaskConvert.INSTANCE.convertList3(tasks, bpmTaskExtDOMap, processInstance, userMap, deptMap); @@ -144,7 +143,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { Map processInstanceMap = processInstanceService.getProcessInstanceMap( convertSet(tasks, Task::getProcessInstanceId)); // 获得 User Map - Map userMap = userCoreService.getUserMap( + Map userMap = adminUserApi.getUserMap( convertSet(processInstanceMap.values(), instance -> Long.valueOf(instance.getStartUserId()))); // 拼接结果 return new PageResult<>(BpmTaskConvert.INSTANCE.convertList1(tasks, processInstanceMap, userMap), @@ -180,7 +179,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { Map historicProcessInstanceMap = processInstanceService.getHistoricProcessInstanceMap( convertSet(tasks, HistoricTaskInstance::getProcessInstanceId)); // 获得 User Map - Map userMap = userCoreService.getUserMap( + Map userMap = adminUserApi.getUserMap( convertSet(historicProcessInstanceMap.values(), instance -> Long.valueOf(instance.getStartUserId()))); // 拼接结果 return new PageResult<>(BpmTaskConvert.INSTANCE.convertList2(tasks, bpmTaskExtDOMap, historicProcessInstanceMap, userMap), @@ -291,7 +290,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { @Override public void afterCommit() { ProcessInstance processInstance = processInstanceService.getProcessInstance(task.getProcessInstanceId()); - SysUserDO startUser = userCoreService.getUser(Long.valueOf(processInstance.getStartUserId())); + AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId())); messageService.sendMessageWhenTaskAssigned(BpmMessageConvert.INSTANCE.convert(processInstance, startUser, task)); } }); diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/test/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmUserTaskActivitiBehaviorTest.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/test/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmUserTaskActivitiBehaviorTest.java index c10a614ae..8d2e1b672 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/test/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmUserTaskActivitiBehaviorTest.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/test/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/BpmUserTaskActivitiBehaviorTest.java @@ -1,21 +1,21 @@ package cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.behavior; import cn.hutool.core.map.MapUtil; -import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmTaskAssignRuleDO; -import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum; -import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskRuleScriptEnum; import cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.behavior.script.BpmTaskAssignScript; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmTaskAssignRuleService; -import cn.iocoder.yudao.module.bpm.api.group.BpmUserGroupServiceApi; -import cn.iocoder.yudao.module.bpm.api.group.dto.BpmUserGroupDTO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; -import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.module.system.service.permission.SysPermissionCoreService; -import cn.iocoder.yudao.module.system.service.user.SysUserCoreService; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmTaskAssignRuleDO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO; +import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum; +import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskRuleScriptEnum; +import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; +import cn.iocoder.yudao.module.system.api.permission.PermissionApi; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import org.activiti.engine.impl.persistence.entity.TaskEntity; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; @@ -40,13 +40,14 @@ public class BpmUserTaskActivitiBehaviorTest extends BaseMockitoUnitTest { @Mock private BpmTaskAssignRuleService bpmTaskRuleService; @Mock - private SysPermissionCoreService permissionCoreService; + private BpmUserGroupService userGroupService; + @Mock - private SysDeptCoreService deptCoreService; + private DeptApi deptApi; @Mock - private BpmUserGroupServiceApi userGroupServiceApi; + private AdminUserApi adminUserApi; @Mock - private SysUserCoreService userCoreService; + private PermissionApi permissionApi; @Test public void testCalculateTaskCandidateUsers_Role() { @@ -54,7 +55,7 @@ public class BpmUserTaskActivitiBehaviorTest extends BaseMockitoUnitTest { BpmTaskAssignRuleDO rule = new BpmTaskAssignRuleDO().setOptions(asSet(1L, 2L)) .setType(BpmTaskAssignRuleTypeEnum.ROLE.getType()); // mock 方法 - when(permissionCoreService.getUserRoleIdListByRoleIds(eq(rule.getOptions()))) + when(permissionApi.getUserRoleIdListByRoleIds(eq(rule.getOptions()))) .thenReturn(asSet(11L, 22L)); mockGetUserMap(asSet(11L, 22L)); @@ -70,9 +71,9 @@ public class BpmUserTaskActivitiBehaviorTest extends BaseMockitoUnitTest { BpmTaskAssignRuleDO rule = new BpmTaskAssignRuleDO().setOptions(asSet(1L, 2L)) .setType(BpmTaskAssignRuleTypeEnum.DEPT_MEMBER.getType()); // mock 方法 - List users = CollectionUtils.convertList(asSet(11L, 22L), - id -> new SysUserDO().setId(id)); - when(userCoreService.getUsersByDeptIds(eq(rule.getOptions()))).thenReturn(users); + List users = CollectionUtils.convertList(asSet(11L, 22L), + id -> new AdminUserRespDTO().setId(id)); + when(adminUserApi.getUsersByDeptIds(eq(rule.getOptions()))).thenReturn(users); mockGetUserMap(asSet(11L, 22L)); // 调用 @@ -87,9 +88,9 @@ public class BpmUserTaskActivitiBehaviorTest extends BaseMockitoUnitTest { BpmTaskAssignRuleDO rule = new BpmTaskAssignRuleDO().setOptions(asSet(1L, 2L)) .setType(BpmTaskAssignRuleTypeEnum.DEPT_LEADER.getType()); // mock 方法 - SysDeptDO dept1 = randomPojo(SysDeptDO.class, o -> o.setLeaderUserId(11L)); - SysDeptDO dept2 = randomPojo(SysDeptDO.class, o -> o.setLeaderUserId(22L)); - when(deptCoreService.getDepts(eq(rule.getOptions()))).thenReturn(Arrays.asList(dept1, dept2)); + DeptRespDTO dept1 = randomPojo(DeptRespDTO.class, o -> o.setLeaderUserId(11L)); + DeptRespDTO dept2 = randomPojo(DeptRespDTO.class, o -> o.setLeaderUserId(22L)); + when(deptApi.getDepts(eq(rule.getOptions()))).thenReturn(Arrays.asList(dept1, dept2)); mockGetUserMap(asSet(11L, 22L)); // 调用 @@ -104,9 +105,9 @@ public class BpmUserTaskActivitiBehaviorTest extends BaseMockitoUnitTest { BpmTaskAssignRuleDO rule = new BpmTaskAssignRuleDO().setOptions(asSet(1L, 2L)) .setType(BpmTaskAssignRuleTypeEnum.POST.getType()); // mock 方法 - List users = CollectionUtils.convertList(asSet(11L, 22L), - id -> new SysUserDO().setId(id)); - when(userCoreService.getUsersByPostIds(eq(rule.getOptions()))).thenReturn(users); + List users = CollectionUtils.convertList(asSet(11L, 22L), + id -> new AdminUserRespDTO().setId(id)); + when(adminUserApi.getUsersByPostIds(eq(rule.getOptions()))).thenReturn(users); mockGetUserMap(asSet(11L, 22L)); // 调用 @@ -135,9 +136,9 @@ public class BpmUserTaskActivitiBehaviorTest extends BaseMockitoUnitTest { BpmTaskAssignRuleDO rule = new BpmTaskAssignRuleDO().setOptions(asSet(1L, 2L)) .setType(BpmTaskAssignRuleTypeEnum.USER_GROUP.getType()); // mock 方法 - BpmUserGroupDTO userGroup1 = randomPojo(BpmUserGroupDTO.class, o -> o.setMemberUserIds(asSet(11L, 12L))); - BpmUserGroupDTO userGroup2 = randomPojo(BpmUserGroupDTO.class, o -> o.setMemberUserIds(asSet(21L, 22L))); - when(userGroupServiceApi.getUserGroupList(eq(rule.getOptions()))).thenReturn(Arrays.asList(userGroup1, userGroup2)); + BpmUserGroupDO userGroup1 = randomPojo(BpmUserGroupDO.class, o -> o.setMemberUserIds(asSet(11L, 12L))); + BpmUserGroupDO userGroup2 = randomPojo(BpmUserGroupDO.class, o -> o.setMemberUserIds(asSet(21L, 22L))); + when(userGroupService.getUserGroupList(eq(rule.getOptions()))).thenReturn(Arrays.asList(userGroup1, userGroup2)); mockGetUserMap(asSet(11L, 12L, 21L, 22L)); // 调用 @@ -190,13 +191,13 @@ public class BpmUserTaskActivitiBehaviorTest extends BaseMockitoUnitTest { // 准备参数. 1L 可以找到;2L 是禁用的;3L 找不到 Set assigneeUserIds = asSet(1L, 2L, 3L); // mock 方法 - SysUserDO user1 = randomPojo(SysUserDO.class, o -> o.setId(1L) + AdminUserRespDTO user1 = randomPojo(AdminUserRespDTO.class, o -> o.setId(1L) .setStatus(CommonStatusEnum.ENABLE.getStatus())); - SysUserDO user2 = randomPojo(SysUserDO.class, o -> o.setId(2L) + AdminUserRespDTO user2 = randomPojo(AdminUserRespDTO.class, o -> o.setId(2L) .setStatus(CommonStatusEnum.DISABLE.getStatus())); - Map userMap = MapUtil.builder(user1.getId(), user1) + Map userMap = MapUtil.builder(user1.getId(), user1) .put(user2.getId(), user2).build(); - when(userCoreService.getUserMap(eq(assigneeUserIds))).thenReturn(userMap); + when(adminUserApi.getUserMap(eq(assigneeUserIds))).thenReturn(userMap); // 调用 behavior.removeDisableUsers(assigneeUserIds); @@ -205,9 +206,9 @@ public class BpmUserTaskActivitiBehaviorTest extends BaseMockitoUnitTest { } private void mockGetUserMap(Set assigneeUserIds) { - Map userMap = CollectionUtils.convertMap(assigneeUserIds, id -> id, - id -> new SysUserDO().setId(id).setStatus(CommonStatusEnum.ENABLE.getStatus())); - when(userCoreService.getUserMap(eq(assigneeUserIds))).thenReturn(userMap); + Map userMap = CollectionUtils.convertMap(assigneeUserIds, id -> id, + id -> new AdminUserRespDTO().setId(id).setStatus(CommonStatusEnum.ENABLE.getStatus())); + when(adminUserApi.getUserMap(eq(assigneeUserIds))).thenReturn(userMap); } } diff --git a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/test/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/script/impl/BpmTaskAssignLeaderX2ScriptTest.java b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/test/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/script/impl/BpmTaskAssignLeaderX2ScriptTest.java index bc0ab21e6..8be8fc4d1 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/test/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/script/impl/BpmTaskAssignLeaderX2ScriptTest.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-activiti/src/test/java/cn/iocoder/yudao/adminserver/modules/bpm/framework/activiti/core/behavior/script/impl/BpmTaskAssignLeaderX2ScriptTest.java @@ -1,16 +1,16 @@ package cn.iocoder.yudao.adminserver.modules.bpm.framework.activiti.core.behavior.script.impl; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.SysUserDO; -import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; -import cn.iocoder.yudao.module.system.service.user.SysUserCoreService; import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import org.activiti.engine.impl.persistence.entity.ExecutionEntityImpl; import org.activiti.engine.impl.persistence.entity.TaskEntity; import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; -import org.mockito.Mock; +import org.springframework.boot.test.mock.mockito.MockBean; import java.util.Set; @@ -25,18 +25,18 @@ class BpmTaskAssignLeaderX2ScriptTest extends BaseMockitoUnitTest { @InjectMocks private BpmTaskAssignLeaderX2Script script; - @Mock - private SysUserCoreService userCoreService; - @Mock - private SysDeptCoreService deptCoreService; + @MockBean + private AdminUserApi adminUserApi; + @MockBean + private DeptApi deptApi; @Test public void testCalculateTaskCandidateUsers_noDept() { // 准备参数 TaskEntity task = buildTaskEntity(1L); // mock 方法(startUser) - SysUserDO startUser = randomPojo(SysUserDO.class, o -> o.setDeptId(10L)); - when(userCoreService.getUser(eq(1L))).thenReturn(startUser); + AdminUserRespDTO startUser = randomPojo(AdminUserRespDTO.class, o -> o.setDeptId(10L)); + when(adminUserApi.getUser(eq(1L))).thenReturn(startUser); // 调用 Set result = script.calculateTaskCandidateUsers(task); @@ -49,11 +49,11 @@ class BpmTaskAssignLeaderX2ScriptTest extends BaseMockitoUnitTest { // 准备参数 TaskEntity task = buildTaskEntity(1L); // mock 方法(startUser) - SysUserDO startUser = randomPojo(SysUserDO.class, o -> o.setDeptId(10L)); - when(userCoreService.getUser(eq(1L))).thenReturn(startUser); - SysDeptDO startUserDept = randomPojo(SysDeptDO.class, o -> o.setId(10L).setParentId(100L) + AdminUserRespDTO startUser = randomPojo(AdminUserRespDTO.class, o -> o.setDeptId(10L)); + when(adminUserApi.getUser(eq(1L))).thenReturn(startUser); + DeptRespDTO startUserDept = randomPojo(DeptRespDTO.class, o -> o.setId(10L).setParentId(100L) .setLeaderUserId(20L)); - when(deptCoreService.getDept(eq(10L))).thenReturn(startUserDept); + when(deptApi.getDept(eq(10L))).thenReturn(startUserDept); // 调用 Set result = script.calculateTaskCandidateUsers(task); @@ -66,15 +66,15 @@ class BpmTaskAssignLeaderX2ScriptTest extends BaseMockitoUnitTest { // 准备参数 TaskEntity task = buildTaskEntity(1L); // mock 方法(startUser) - SysUserDO startUser = randomPojo(SysUserDO.class, o -> o.setDeptId(10L)); - when(userCoreService.getUser(eq(1L))).thenReturn(startUser); - SysDeptDO startUserDept = randomPojo(SysDeptDO.class, o -> o.setId(10L).setParentId(100L) + AdminUserRespDTO startUser = randomPojo(AdminUserRespDTO.class, o -> o.setDeptId(10L)); + when(adminUserApi.getUser(eq(1L))).thenReturn(startUser); + DeptRespDTO startUserDept = randomPojo(DeptRespDTO.class, o -> o.setId(10L).setParentId(100L) .setLeaderUserId(20L)); - when(deptCoreService.getDept(eq(10L))).thenReturn(startUserDept); + when(deptApi.getDept(eq(10L))).thenReturn(startUserDept); // mock 方法(父 dept) - SysDeptDO parentDept = randomPojo(SysDeptDO.class, o -> o.setId(100L).setParentId(1000L) + DeptRespDTO parentDept = randomPojo(DeptRespDTO.class, o -> o.setId(100L).setParentId(1000L) .setLeaderUserId(200L)); - when(deptCoreService.getDept(eq(100L))).thenReturn(parentDept); + when(deptApi.getDept(eq(100L))).thenReturn(parentDept); // 调用 Set result = script.calculateTaskCandidateUsers(task); diff --git a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/auth/AuthConvert.java b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/auth/AuthConvert.java index 323827d4f..f443765cd 100644 --- a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/auth/AuthConvert.java +++ b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/auth/AuthConvert.java @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.module.member.controller.app.auth.vo.*; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeSendReqDTO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeUseReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; import cn.iocoder.yudao.module.system.api.social.dto.SocialUserUnbindReqDTO; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; diff --git a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java index ad12b40a6..fcfe3ae51 100644 --- a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java +++ b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java @@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobile import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper; import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeUseReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; import com.google.common.annotations.VisibleForTesting; import lombok.extern.slf4j.Slf4j; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java new file mode 100644 index 000000000..d228fc3b7 --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java @@ -0,0 +1,50 @@ +package cn.iocoder.yudao.module.system.api.dept; + +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 部门 API 接口 + * + * @author 芋道源码 + */ +public interface DeptApi { + + /** + * 获得部门信息 + * + * @param id 部门编号 + * @return 部门信息 + */ + DeptRespDTO getDept(Long id); + + /** + * 获得部门信息数组 + * + * @param ids 部门编号数组 + * @return 部门信息数组 + */ + List getDepts(Collection ids); + + /** + * 校验部门们是否有效。如下情况,视为无效: + * 1. 部门编号不存在 + * 2. 部门被禁用 + * + * @param ids 角色编号数组 + */ + void validDepts(Collection ids); + + /** + * 获得指定编号的部门 Map + * + * @param ids 部门编号数组 + * @return 部门 Map + */ + Map getDeptMap(Set ids); + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java new file mode 100644 index 000000000..d1e3d47a1 --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.system.api.dept; + +import java.util.Collection; + +/** + * 岗位 API 接口 + * + * @author 芋道源码 + */ +public interface PostApi { + + /** + * 校验岗位们是否有效。如下情况,视为无效: + * 1. 岗位编号不存在 + * 2. 岗位被禁用 + * + * @param ids 岗位编号数组 + */ + void validPosts(Collection ids); + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java new file mode 100644 index 000000000..d3e66fdd8 --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.system.api.dept.dto; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import lombok.Data; + +/** + * 部门 Response DTO + * + * @author 芋道源码 + */ +@Data +public class DeptRespDTO { + + /** + * 部门编号 + */ + private Long id; + /** + * 部门名称 + */ + private String name; + /** + * 父部门编号 + */ + private Long parentId; + /** + * 负责人的用户编号 + */ + private Long leaderUserId; + /** + * 部门状态 + * + * 枚举 {@link CommonStatusEnum} + */ + private Integer status; + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java new file mode 100644 index 000000000..35393a04a --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.system.api.dict; + +import java.util.Collection; + +/** + * 字典数据 API 接口 + * + * @author 芋道源码 + */ +public interface DictDataApi { + + /** + * 校验字典数据们是否有效。如下情况,视为无效: + * 1. 字典数据不存在 + * 2. 字典数据被禁用 + * + * @param dictType 字典类型 + * @param values 字典数据值的数组 + */ + void validDictDatas(String dictType, Collection values); + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java new file mode 100644 index 000000000..04e963869 --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.system.api.permission; + +import java.util.Collection; +import java.util.Set; + +/** + * 权限 API 接口 + * + * @author 芋道源码 + */ +public interface PermissionApi { + + /** + * 获得拥有多个角色的用户编号集合 + * + * @param roleIds 角色编号集合 + * @return 用户编号集合 + */ + Set getUserRoleIdListByRoleIds(Collection roleIds); + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java new file mode 100644 index 000000000..14133e9d9 --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.system.api.permission; + +import java.util.Collection; + +/** + * 角色 API 接口 + * + * @author 芋道源码 + */ +public interface RoleApi { + + /** + * 校验角色们是否有效。如下情况,视为无效: + * 1. 角色编号不存在 + * 2. 角色被禁用 + * + * @param ids 角色编号数组 + */ + void validRoles(Collection ids); + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApi.java index 1a3aea7ee..ffcf46dc0 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApi.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.module.system.api.sms; import cn.iocoder.yudao.framework.common.exception.ServiceException; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeCheckReqDTO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeSendReqDTO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeUseReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeCheckReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; import javax.validation.Valid; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsSendApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsSendApi.java new file mode 100644 index 000000000..c86bbf503 --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsSendApi.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.system.api.sms; + +import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO; + +import javax.validation.Valid; + +/** + * 短信发送 API 接口 + * + * @author 芋道源码 + */ +public interface SmsSendApi { + + /** + * 发送单条短信给 Admin 用户 + * + * 在 mobile 为空时,使用 userId 加载对应 Admin 的手机号 + * + * @param reqDTO 发送请求 + * @return 发送日志编号 + */ + Long sendSingleSmsToAdmin(@Valid SmsSendSingleToUserReqDTO reqDTO); + + /** + * 发送单条短信给 Member 用户 + * + * 在 mobile 为空时,使用 userId 加载对应 Member 的手机号 + * + * @param reqDTO 发送请求 + * @return 发送日志编号 + */ + Long sendSingleSmsToMember(@Valid SmsSendSingleToUserReqDTO reqDTO); + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/SmsCodeCheckReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeCheckReqDTO.java similarity index 92% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/SmsCodeCheckReqDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeCheckReqDTO.java index 2fd1ed668..d6ca3c698 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/SmsCodeCheckReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeCheckReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.api.sms.dto; +package cn.iocoder.yudao.module.system.api.sms.dto.code; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/SmsCodeSendReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java similarity index 92% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/SmsCodeSendReqDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java index 088899aac..2d2a4c7e3 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/SmsCodeSendReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.api.sms.dto; +package cn.iocoder.yudao.module.system.api.sms.dto.code; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/SmsCodeUseReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeUseReqDTO.java similarity index 93% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/SmsCodeUseReqDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeUseReqDTO.java index eedc2a90a..3a639f46e 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/SmsCodeUseReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeUseReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.system.api.sms.dto; +package cn.iocoder.yudao.module.system.api.sms.dto.code; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/send/SmsSendSingleToUserReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/send/SmsSendSingleToUserReqDTO.java new file mode 100644 index 000000000..7701f714e --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/send/SmsSendSingleToUserReqDTO.java @@ -0,0 +1,38 @@ +package cn.iocoder.yudao.module.system.api.sms.dto.send; + +import cn.iocoder.yudao.framework.common.validation.Mobile; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Map; + +/** + * 短信发送给 Admin 或者 Member 用户 + * + * @author 芋道源码 + */ +@Data +public class SmsSendSingleToUserReqDTO { + + /** + * 用户编号 + */ + @NotNull(message = "用户编号不能为空") + private Long userId; + /** + * 手机号 + */ + @Mobile + private String mobile; + /** + * 短信模板编号 + */ + @NotEmpty(message = "短信模板编号不能为空") + private String templateCode; + /** + * 短信模板参数 + */ + private Map templateParams; + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java new file mode 100644 index 000000000..d994b0cb3 --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java @@ -0,0 +1,58 @@ +package cn.iocoder.yudao.module.system.api.user; + +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Admin 用户 API 接口 + * + * @author 芋道源码 + */ +public interface AdminUserApi { + + /** + * 通过用户 ID 查询用户 + * + * @param id 用户ID + * @return 用户对象信息 + */ + AdminUserRespDTO getUser(Long id); + + /** + * 获得指定部门的用户数组 + * + * @param deptIds 部门数组 + * @return 用户数组 + */ + List getUsersByDeptIds(Collection deptIds); + + /** + * 获得指定岗位的用户数组 + * + * @param postIds 岗位数组 + * @return 用户数组 + */ + List getUsersByPostIds(Collection postIds); + + /** + * 获得用户 Map + * + * @param ids 用户编号数组 + * @return 用户 Map + */ + Map getUserMap(Collection ids); + + /** + * 校验用户们是否有效。如下情况,视为无效: + * 1. 用户编号不存在 + * 2. 用户被禁用 + * + * @param ids 用户编号数组 + */ + void validUsers(Set ids); + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java new file mode 100644 index 000000000..ac13c3a8b --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.module.system.api.user.dto; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import lombok.Data; + +import java.util.Set; + +/** + * Admin 用户 Response DTO + * + * @author 芋道源码 + */ +@Data +public class AdminUserRespDTO { + + /** + * 用户ID + */ + private Long id; + /** + * 用户昵称 + */ + private String nickname; + /** + * 帐号状态 + * + * 枚举 {@link CommonStatusEnum} + */ + private Integer status; + + /** + * 部门ID + */ + private Long deptId; + /** + * 岗位编号数组 + */ + private Set postIds; + /** + * 手机号码 + */ + private String mobile; + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java new file mode 100644 index 000000000..27fbc2f13 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java @@ -0,0 +1,49 @@ +package cn.iocoder.yudao.module.system.api.dept; + +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; +import cn.iocoder.yudao.module.system.convert.dept.DeptConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.service.dept.DeptService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 部门 API 实现类 + * + * @author 芋道源码 + */ +@Service +public class DeptApiImpl implements DeptApi { + + @Resource + private DeptService deptService; + + @Override + public DeptRespDTO getDept(Long id) { + DeptDO dept = deptService.getDept(id); + return DeptConvert.INSTANCE.convert03(dept); + } + + @Override + public List getDepts(Collection ids) { + List depts = deptService.getDepts(ids); + return DeptConvert.INSTANCE.convertList03(depts); + } + + @Override + public void validDepts(Collection ids) { + deptService.validDepts(ids); + } + + @Override + public Map getDeptMap(Set ids) { + Map depts = deptService.getDeptMap(ids); + return DeptConvert.INSTANCE.convertMap(depts); + } + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java new file mode 100644 index 000000000..5d2b55078 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java @@ -0,0 +1,26 @@ +package cn.iocoder.yudao.module.system.api.permission; + +import cn.iocoder.yudao.module.system.service.permission.PermissionService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.Set; + +/** + * 权限 API 实现类 + * + * @author 芋道源码 + */ +@Service +public class PermissionApiImpl implements PermissionApi { + + @Resource + private PermissionService permissionService; + + @Override + public Set getUserRoleIdListByRoleIds(Collection roleIds) { + return permissionService.getUserRoleIdListByRoleIds(roleIds); + } + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApiImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApiImpl.java index 73d73b42f..81957e082 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApiImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApiImpl.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.system.api.sms; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeCheckReqDTO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeSendReqDTO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeUseReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeCheckReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; import cn.iocoder.yudao.module.system.service.sms.SmsCodeService; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsSendApiImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsSendApiImpl.java new file mode 100644 index 000000000..ee5812d3c --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsSendApiImpl.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.system.api.sms; + +import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO; +import cn.iocoder.yudao.module.system.service.sms.SmsSendService; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +/** + * 短信发送 API 接口 + * + * @author 芋道源码 + */ +@Service +@Validated +public class SmsSendApiImpl implements SmsSendApi { + + @Resource + private SmsSendService smsSendService; + + @Override + public Long sendSingleSmsToAdmin(SmsSendSingleToUserReqDTO reqDTO) { + return smsSendService.sendSingleSmsToAdmin(reqDTO.getMobile(), reqDTO.getUserId(), + reqDTO.getTemplateCode(), reqDTO.getTemplateParams()); + } + + @Override + public Long sendSingleSmsToMember(SmsSendSingleToUserReqDTO reqDTO) { + return smsSendService.sendSingleSmsToMember(reqDTO.getMobile(), reqDTO.getUserId(), + reqDTO.getTemplateCode(), reqDTO.getTemplateParams()); + } + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java new file mode 100644 index 000000000..372e6f5e6 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.system.api.user; + +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; +import cn.iocoder.yudao.module.system.convert.user.UserConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Admin 用户 API 实现类 + * + * @author 芋道源码 + */ +@Service +public class AdminUserApiImpl implements AdminUserApi { + + @Resource + private AdminUserService userService; + + @Override + public AdminUserRespDTO getUser(Long id) { + AdminUserDO user = userService.getUser(id); + return UserConvert.INSTANCE.convert4(user); + } + + @Override + public List getUsersByDeptIds(Collection deptIds) { + List users = userService.getUsersByDeptIds(deptIds); + return UserConvert.INSTANCE.convertList4(users); + } + + @Override + public List getUsersByPostIds(Collection postIds) { + List users = userService.getUsersByPostIds(postIds); + return UserConvert.INSTANCE.convertList4(users); + } + + @Override + public Map getUserMap(Collection ids) { + Map userMap = userService.getUserMap(ids); + return UserConvert.INSTANCE.convertMap4(userMap); + } + + @Override + public void validUsers(Set ids) { + userService.validUsers(ids); + } + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java index 8d921131c..2a514743b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.system.convert.dept; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSimpleRespVO; @@ -9,6 +10,7 @@ import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; import java.util.List; +import java.util.Map; @Mapper public interface DeptConvert { @@ -25,4 +27,10 @@ public interface DeptConvert { DeptDO convert(DeptUpdateReqVO bean); + List convertList03(List list); + + DeptRespDTO convert03(DeptDO bean); + + Map convertMap(Map map); + } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java index cf2b1692b..2e8a47336 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.system.convert.user; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileRespVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; @@ -13,6 +14,7 @@ import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; import java.util.List; +import java.util.Map; @Mapper public interface UserConvert { @@ -46,4 +48,11 @@ public interface UserConvert { List convertList03(List list); List convertList04(List list); + + AdminUserRespDTO convert4(AdminUserDO bean); + + List convertList4(List users); + + Map convertMap4(Map map); + } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java index 3716c906f..a6c30bc10 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java @@ -46,7 +46,6 @@ public interface DeptService { */ void deleteDept(Long id); - /** * 筛选部门列表 * diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeService.java index f427b6a2f..f71b8a6bd 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeService.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.module.system.service.sms; import cn.iocoder.yudao.framework.common.exception.ServiceException; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeCheckReqDTO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeSendReqDTO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeUseReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeCheckReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; import javax.validation.Valid; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImpl.java index b30f31dd0..c1d366584 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImpl.java @@ -4,9 +4,9 @@ import cn.hutool.core.lang.Assert; import cn.hutool.core.map.MapUtil; import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeCheckReqDTO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeSendReqDTO; -import cn.iocoder.yudao.module.system.api.sms.dto.SmsCodeUseReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeCheckReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsCodeDO; import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsCodeMapper; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; @@ -36,11 +36,6 @@ public class SmsCodeServiceImpl implements SmsCodeService { @Resource private SmsCodeMapper smsCodeMapper; - @Resource - private AdminUserService adminUserService; - @Resource - private MemberUserApi memberUserApi; - @Resource private SmsSendService smsSendService;