From cc9a2199b1ab4090f0dc727b6858746b4b2eaa39 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 22 Jan 2022 19:20:00 +0800 Subject: [PATCH] =?UTF-8?q?bpm=20=E7=9A=84=20OA=20=E8=AF=B7=E5=81=87?= =?UTF-8?q?=E7=9A=84=E5=88=97=E8=A1=A8=E7=9A=84=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...LeaveBaseVO.java => BpmOALeaveBaseVO.java} | 27 +-- .../controller/oa/vo/OALeaveCreateReqVO.java | 20 +- .../bpm/controller/oa/vo/OALeaveRespVO.java | 21 +- .../bpm/dal/mysql/oa/BpmOALeaveMapper.java | 2 +- yudao-admin-ui/src/api/oa/leave.js | 21 +- yudao-admin-ui/src/router/index.js | 16 +- yudao-admin-ui/src/utils/dict.js | 2 +- .../index.vue => bpm/oa/leave/create.vue} | 4 +- .../src/views/{ => bpm}/oa/leave/index.vue | 200 +++-------------- yudao-admin-ui/src/views/oa/flow/index.vue | 36 --- .../src/views/oa/leave/approve/index.vue | 212 ------------------ 11 files changed, 67 insertions(+), 494 deletions(-) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/{OALeaveBaseVO.java => BpmOALeaveBaseVO.java} (53%) rename yudao-admin-ui/src/views/{oa/leave/apply/index.vue => bpm/oa/leave/create.vue} (97%) rename yudao-admin-ui/src/views/{ => bpm}/oa/leave/index.vue (55%) delete mode 100644 yudao-admin-ui/src/views/oa/flow/index.vue delete mode 100644 yudao-admin-ui/src/views/oa/leave/approve/index.vue diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveBaseVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveBaseVO.java similarity index 53% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveBaseVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveBaseVO.java index 72d1a5e70..e7128b50d 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveBaseVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveBaseVO.java @@ -13,36 +13,21 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 */ @Data -public class OALeaveBaseVO { +public class BpmOALeaveBaseVO { - @ApiModelProperty(value = "流程id") - private String processInstanceId; - - @ApiModelProperty(value = "状态", required = true) - private Integer status; - - @ApiModelProperty(value = "申请人id", required = true) - private String userId; - - @ApiModelProperty(value = "开始时间", required = true) + @ApiModelProperty(value = "请假的开始时间", required = true) @NotNull(message = "开始时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private Date startTime; - - @ApiModelProperty(value = "结束时间", required = true) + @ApiModelProperty(value = "请假的结束时间", required = true) @NotNull(message = "结束时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private Date endTime; - @ApiModelProperty(value = "请假类型") - private String leaveType; + @ApiModelProperty(value = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type 枚举") + private Integer type; - @ApiModelProperty(value = "原因") + @ApiModelProperty(value = "原因", required = true, example = "阅读芋道源码") private String reason; - @ApiModelProperty(value = "申请时间", required = true) - @NotNull(message = "申请时间不能为空") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private Date applyTime; - } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveCreateReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveCreateReqVO.java index 762e19862..4fbe3148e 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveCreateReqVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveCreateReqVO.java @@ -12,21 +12,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ApiModel("请假申请创建 Request VO") @Data -public class OALeaveCreateReqVO { - - @ApiModelProperty(value = "请假的开始时间", required = true) - @NotNull(message = "开始时间不能为空") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private Date startTime; - @ApiModelProperty(value = "请假的结束时间", required = true) - @NotNull(message = "结束时间不能为空") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private Date endTime; - - @ApiModelProperty(value = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type") - private Integer type; - - @ApiModelProperty(value = "原因", required = true, example = "阅读芋道源码") - private String reason; - +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class OALeaveCreateReqVO extends BpmOALeaveBaseVO { } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveRespVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveRespVO.java index 161879cc0..19292b7c9 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveRespVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveRespVO.java @@ -2,14 +2,31 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo; import lombok.*; import io.swagger.annotations.*; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @ApiModel("请假申请 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class OALeaveRespVO extends OALeaveBaseVO { +public class OALeaveRespVO extends BpmOALeaveBaseVO { - @ApiModelProperty(value = "请假表单主键", required = true) + @ApiModelProperty(value = "请假表单主键", required = true, example = "1024") private Long id; + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 bpm_process_instance_result 枚举") + private Integer result; + + @ApiModelProperty(value = "申请时间", required = true) + @NotNull(message = "申请时间不能为空") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date createTime; + + @ApiModelProperty(value = "流程id") + private String processInstanceId; + } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/oa/BpmOALeaveMapper.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/oa/BpmOALeaveMapper.java index 8248ea71e..f16bc6edf 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/oa/BpmOALeaveMapper.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/oa/BpmOALeaveMapper.java @@ -18,7 +18,7 @@ public interface BpmOALeaveMapper extends BaseMapperX { default PageResult selectPage(Long userId, OALeavePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(OALeaveDO::getId, userId) + .eqIfPresent(OALeaveDO::getUserId, userId) .eqIfPresent(OALeaveDO::getResult, reqVO.getResult()) .eqIfPresent(OALeaveDO::getType, reqVO.getType()) .likeIfPresent(OALeaveDO::getReason, reqVO.getReason()) diff --git a/yudao-admin-ui/src/api/oa/leave.js b/yudao-admin-ui/src/api/oa/leave.js index b6a8eb00b..2c51f3e47 100644 --- a/yudao-admin-ui/src/api/oa/leave.js +++ b/yudao-admin-ui/src/api/oa/leave.js @@ -9,15 +9,6 @@ export function createLeave(data) { }) } -// 更新请假申请 -export function updateLeave(data) { - return request({ - url: '/oa/leave/update', - method: 'put', - data: data - }) -} - // 删除请假申请 export function deleteLeave(id) { return request({ @@ -37,7 +28,7 @@ export function getLeave(id) { // 获得请假申请分页 export function getLeavePage(query) { return request({ - url: '/oa/leave/page', + url: '/bpm/oa/leave/page', method: 'get', params: query }) @@ -57,13 +48,3 @@ export function getLeaveApplyMembers() { method: 'get' }) } - -// 导出请假申请 Excel -export function exportLeaveExcel(query) { - return request({ - url: '/oa/leave/export-excel', - method: 'get', - params: query, - responseType: 'blob' - }) -} diff --git a/yudao-admin-ui/src/router/index.js b/yudao-admin-ui/src/router/index.js index 810b63a0f..79529d446 100644 --- a/yudao-admin-ui/src/router/index.js +++ b/yudao-admin-ui/src/router/index.js @@ -130,26 +130,12 @@ export const constantRoutes = [ children: [ { path: 'leave/apply', - component: (resolve) => require(['@/views/oa/leave/apply/index'], resolve), + component: (resolve) => require(['@/views/bpm/oa/leave/create'], resolve), name: '请假表单-申请', meta: { title: '请假表单-申请', icon: 'form' } } ] }, - { - path: '/flow', - component: Layout, - hidden: true, - redirect: 'noredirect', - children: [ - { - path: 'leave/approve', - component: (resolve) => require(['@/views/oa/leave/approve/index'], resolve), - name: '请假表单-审批', - meta: { title: '请假表单-审批', icon: 'form' } - } - ] - }, { path: '/bpm', component: Layout, diff --git a/yudao-admin-ui/src/utils/dict.js b/yudao-admin-ui/src/utils/dict.js index 815a98d65..3d97494e7 100644 --- a/yudao-admin-ui/src/utils/dict.js +++ b/yudao-admin-ui/src/utils/dict.js @@ -42,7 +42,7 @@ export const DICT_TYPE = { BPM_PROCESS_INSTANCE_RESULT: 'bpm_process_instance_result', BPM_TASK_ASSIGN_SCRIPT: 'bpm_task_assign_script', OA_LEAVE_STATUS: 'flow_status', // todo 芋艿:可以删除 - OA_LEAVE_TYPE: 'oa_leave_type' + BPM_OA_LEAVE_TYPE: 'bpm_oa_leave_type' } /** diff --git a/yudao-admin-ui/src/views/oa/leave/apply/index.vue b/yudao-admin-ui/src/views/bpm/oa/leave/create.vue similarity index 97% rename from yudao-admin-ui/src/views/oa/leave/apply/index.vue rename to yudao-admin-ui/src/views/bpm/oa/leave/create.vue index 6a9752e9e..b56167802 100644 --- a/yudao-admin-ui/src/views/oa/leave/apply/index.vue +++ b/yudao-admin-ui/src/views/bpm/oa/leave/create.vue @@ -41,7 +41,7 @@ import { createFormKeyLeave} from "@/api/oa/leave" import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict' export default { - name: "ApplyLeave", + name: "LeaveCreate", components: { }, data() { @@ -65,7 +65,7 @@ export default { statusFormat(row, column) { return getDictDataLabel(DICT_TYPE.OA_LEAVE_STATUS, row.status) }, - leaveTypeDictData: getDictDatas(DICT_TYPE.OA_LEAVE_TYPE), + leaveTypeDictData: getDictDatas(DICT_TYPE.BPM_OA_LEAVE_TYPE), leaveStatusData: getDictDatas(DICT_TYPE.OA_LEAVE_STATUS) }; }, diff --git a/yudao-admin-ui/src/views/oa/leave/index.vue b/yudao-admin-ui/src/views/bpm/oa/leave/index.vue similarity index 55% rename from yudao-admin-ui/src/views/oa/leave/index.vue rename to yudao-admin-ui/src/views/bpm/oa/leave/index.vue index 70ae3fd92..030b55350 100644 --- a/yudao-admin-ui/src/views/oa/leave/index.vue +++ b/yudao-admin-ui/src/views/bpm/oa/leave/index.vue @@ -3,44 +3,24 @@ - - - - - - + + + - - + - - - - - - + + + - - - 搜索 重置 @@ -57,9 +37,8 @@ - - - + + - + @@ -129,7 +108,7 @@ {{ parseTime(form.startTime) }} {{ parseTime(form.endTime) }} - {{ getDictDataLabel(DICT_TYPE.OA_LEAVE_TYPE, form.leaveType) }} + {{ getDictDataLabel(DICT_TYPE.BPM_OA_LEAVE_TYPE, form.leaveType) }} {{form.reason}} {{ parseTime(form.applyTime) }} @@ -140,27 +119,13 @@ - - - - -
-
- - - - -
diff --git a/yudao-admin-ui/src/views/oa/flow/index.vue b/yudao-admin-ui/src/views/oa/flow/index.vue deleted file mode 100644 index 1551bf567..000000000 --- a/yudao-admin-ui/src/views/oa/flow/index.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/yudao-admin-ui/src/views/oa/leave/approve/index.vue b/yudao-admin-ui/src/views/oa/leave/approve/index.vue deleted file mode 100644 index 0857fb1ae..000000000 --- a/yudao-admin-ui/src/views/oa/leave/approve/index.vue +++ /dev/null @@ -1,212 +0,0 @@ - - -