From 9aed2297ee3f1bf1ffd14c139f5c77e3f36e16cb Mon Sep 17 00:00:00 2001
From: zhongrj <123456>
Date: Wed, 24 Aug 2022 18:34:16 +0800
Subject: [PATCH] 请假流程恢复
---
/dev/null | 15 ---
src/main/java/org/springblade/flow/demo/leave/service/ILeaveService.java | 74 +++++++++---------
src/main/java/org/springblade/flow/demo/leave/mapper/LeaveMapper.java | 2
src/main/java/org/springblade/flow/demo/leave/mapper/LeaveMapper.xml | 2
src/main/java/org/springblade/flow/demo/leave/service/impl/LeaveServiceImpl.java | 79 +++++++++++++++++++
src/main/java/org/springblade/flow/demo/leave/controller/LeaveController.java | 65 ++++++++++++++++
6 files changed, 183 insertions(+), 54 deletions(-)
diff --git a/src/main/java/org/springblade/flow/demo/leave/controller/LeaveController.java b/src/main/java/org/springblade/flow/demo/leave/controller/LeaveController.java
new file mode 100644
index 0000000..edc52a4
--- /dev/null
+++ b/src/main/java/org/springblade/flow/demo/leave/controller/LeaveController.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.flow.demo.leave.controller;
+
+import lombok.AllArgsConstructor;
+import org.springblade.common.cache.UserCache;
+import org.springblade.core.launch.constant.AppConstant;
+import org.springblade.core.tenant.annotation.NonDS;
+import org.springblade.core.tool.api.R;
+import org.springblade.flow.demo.leave.entity.ProcessLeave;
+import org.springblade.flow.demo.leave.service.ILeaveService;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ */
+@NonDS
+@ApiIgnore
+@RestController
+@RequestMapping(AppConstant.APPLICATION_DESK_NAME + "/process/leave")
+@AllArgsConstructor
+public class LeaveController {
+
+ private final ILeaveService leaveService;
+
+ /**
+ * 详情
+ *
+ * @param businessId 主键
+ */
+ @GetMapping("detail")
+ public R<ProcessLeave> detail(Long businessId) {
+ ProcessLeave detail = leaveService.getById(businessId);
+ detail.getFlow().setAssigneeName(UserCache.getUser(detail.getCreateUser()).getName());
+ return R.data(detail);
+ }
+
+ /**
+ * 新增或修改
+ *
+ * @param leave 请假信息
+ */
+ @PostMapping("start-process")
+ public R startProcess(@RequestBody ProcessLeave leave) {
+ return R.status(leaveService.startProcess(leave));
+ }
+
+}
diff --git a/src/main/java/org/springblade/flow/demo/leave/controller/LeaveTestController.java b/src/main/java/org/springblade/flow/demo/leave/controller/LeaveTestController.java
deleted file mode 100644
index d5c5b49..0000000
--- a/src/main/java/org/springblade/flow/demo/leave/controller/LeaveTestController.java
+++ /dev/null
@@ -1,65 +0,0 @@
-///*
-// * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
-// *
-// * Redistribution and use in source and binary forms, with or without
-// * modification, are permitted provided that the following conditions are met:
-// *
-// * Redistributions of source code must retain the above copyright notice,
-// * this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// * notice, this list of conditions and the following disclaimer in the
-// * documentation and/or other materials provided with the distribution.
-// * Neither the name of the dreamlu.net developer nor the names of its
-// * contributors may be used to endorse or promote products derived from
-// * this software without specific prior written permission.
-// * Author: Chill 庄骞 (smallchill@163.com)
-// */
-//package org.springblade.flow.demo.leave.controller;
-//
-//import lombok.AllArgsConstructor;
-//import org.springblade.common.cache.UserCache;
-//import org.springblade.core.launch.constant.AppConstant;
-//import org.springblade.core.tenant.annotation.NonDS;
-//import org.springblade.core.tool.api.R;
-//import org.springblade.flow.demo.leave.entity.ProcessLeave;
-//import org.springblade.flow.demo.leave.service.ILeaveService;
-//import org.springframework.web.bind.annotation.*;
-//import springfox.documentation.annotations.ApiIgnore;
-//
-///**
-// * 控制器
-// *
-// * @author Chill
-// */
-//@NonDS
-//@ApiIgnore
-//@RestController
-//@RequestMapping(AppConstant.APPLICATION_DESK_NAME + "/process/leave")
-//@AllArgsConstructor
-//public class LeaveController {
-//
-// private final ILeaveService leaveService;
-//
-// /**
-// * 详情
-// *
-// * @param businessId 主键
-// */
-// @GetMapping("detail")
-// public R<ProcessLeave> detail(Long businessId) {
-// ProcessLeave detail = leaveService.getById(businessId);
-// detail.getFlow().setAssigneeName(UserCache.getUser(detail.getCreateUser()).getName());
-// return R.data(detail);
-// }
-//
-// /**
-// * 新增或修改
-// *
-// * @param leave 请假信息
-// */
-// @PostMapping("start-process")
-// public R startProcess(@RequestBody ProcessLeave leave) {
-// return R.status(leaveService.startProcess(leave));
-// }
-//
-//}
diff --git a/src/main/java/org/springblade/flow/demo/leave/mapper/LeaveTestMapper.java b/src/main/java/org/springblade/flow/demo/leave/mapper/LeaveMapper.java
similarity index 93%
rename from src/main/java/org/springblade/flow/demo/leave/mapper/LeaveTestMapper.java
rename to src/main/java/org/springblade/flow/demo/leave/mapper/LeaveMapper.java
index 42ea510..923f59e 100644
--- a/src/main/java/org/springblade/flow/demo/leave/mapper/LeaveTestMapper.java
+++ b/src/main/java/org/springblade/flow/demo/leave/mapper/LeaveMapper.java
@@ -24,6 +24,6 @@
*
* @author Chill
*/
-public interface LeaveTestMapper extends BaseMapper<ProcessLeave> {
+public interface LeaveMapper extends BaseMapper<ProcessLeave> {
}
diff --git a/src/main/java/org/springblade/flow/demo/leave/mapper/LeaveTestMapper.xml b/src/main/java/org/springblade/flow/demo/leave/mapper/LeaveMapper.xml
similarity index 67%
rename from src/main/java/org/springblade/flow/demo/leave/mapper/LeaveTestMapper.xml
rename to src/main/java/org/springblade/flow/demo/leave/mapper/LeaveMapper.xml
index 62637b1..64ad626 100644
--- a/src/main/java/org/springblade/flow/demo/leave/mapper/LeaveTestMapper.xml
+++ b/src/main/java/org/springblade/flow/demo/leave/mapper/LeaveMapper.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.springblade.flow.demo.leave.mapper.LeaveTestMapper">
+<mapper namespace="org.springblade.flow.demo.leave.mapper.LeaveMapper">
</mapper>
diff --git a/src/main/java/org/springblade/flow/demo/leave/service/ILeaveService.java b/src/main/java/org/springblade/flow/demo/leave/service/ILeaveService.java
index 7b8268a..d52fab9 100644
--- a/src/main/java/org/springblade/flow/demo/leave/service/ILeaveService.java
+++ b/src/main/java/org/springblade/flow/demo/leave/service/ILeaveService.java
@@ -1,37 +1,37 @@
-///*
-// * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
-// *
-// * Redistribution and use in source and binary forms, with or without
-// * modification, are permitted provided that the following conditions are met:
-// *
-// * Redistributions of source code must retain the above copyright notice,
-// * this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// * notice, this list of conditions and the following disclaimer in the
-// * documentation and/or other materials provided with the distribution.
-// * Neither the name of the dreamlu.net developer nor the names of its
-// * contributors may be used to endorse or promote products derived from
-// * this software without specific prior written permission.
-// * Author: Chill 庄骞 (smallchill@163.com)
-// */
-//package org.springblade.flow.demo.leave.service;
-//
-//import org.springblade.core.mp.base.BaseService;
-//import org.springblade.flow.demo.leave.entity.ProcessLeave;
-//
-///**
-// * 服务类
-// *
-// * @author Chill
-// */
-//public interface ILeaveService extends BaseService<ProcessLeave> {
-//
-// /**
-// * 开启流程
-// *
-// * @param leave 请假实体
-// * @return boolean
-// */
-// boolean startProcess(ProcessLeave leave);
-//
-//}
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.flow.demo.leave.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.flow.demo.leave.entity.ProcessLeave;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ */
+public interface ILeaveService extends BaseService<ProcessLeave> {
+
+ /**
+ * 开启流程
+ *
+ * @param leave 请假实体
+ * @return boolean
+ */
+ boolean startProcess(ProcessLeave leave);
+
+}
diff --git a/src/main/java/org/springblade/flow/demo/leave/service/impl/LeaveServiceImpl.java b/src/main/java/org/springblade/flow/demo/leave/service/impl/LeaveServiceImpl.java
new file mode 100644
index 0000000..ff64a58
--- /dev/null
+++ b/src/main/java/org/springblade/flow/demo/leave/service/impl/LeaveServiceImpl.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.flow.demo.leave.service.impl;
+
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.support.Kv;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.flow.business.service.IFlowService;
+import org.springblade.flow.core.constant.ProcessConstant;
+import org.springblade.flow.core.entity.BladeFlow;
+import org.springblade.flow.core.utils.FlowUtil;
+import org.springblade.flow.core.utils.TaskUtil;
+import org.springblade.flow.demo.leave.entity.ProcessLeave;
+import org.springblade.flow.demo.leave.mapper.LeaveMapper;
+import org.springblade.flow.demo.leave.service.ILeaveService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ */
+@Slf4j
+@Service
+@AllArgsConstructor
+public class LeaveServiceImpl extends BaseServiceImpl<LeaveMapper, ProcessLeave> implements ILeaveService {
+
+ private final IFlowService flowService;
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public boolean startProcess(ProcessLeave leave) {
+ String businessTable = FlowUtil.getBusinessTable(ProcessConstant.LEAVE_KEY);
+ if (Func.isEmpty(leave.getId())) {
+ // 保存leave
+ leave.setApplyTime(DateUtil.now());
+ save(leave);
+ // 启动流程
+ Kv variables = Kv.create()
+ .set(ProcessConstant.TASK_VARIABLE_CREATE_USER, AuthUtil.getUserName())
+ .set("taskUser", TaskUtil.getTaskUser(leave.getTaskUser()))
+ .set("days", DateUtil.between(leave.getStartTime(), leave.getEndTime()).toDays());
+ BladeFlow flow = flowService.startProcessInstanceById(leave.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(leave.getId())), variables);
+ if (Func.isNotEmpty(flow)) {
+ log.debug("流程已启动,流程ID:" + flow.getProcessInstanceId());
+ // 返回流程id写入leave
+ leave.setProcessInstanceId(flow.getProcessInstanceId());
+ updateById(leave);
+ } else {
+ throw new ServiceException("开启流程失败");
+ }
+ } else {
+
+ updateById(leave);
+ }
+ return true;
+ }
+
+}
diff --git a/src/main/java/org/springblade/flow/demo/leave/service/impl/LeaveTestServiceImpl.java b/src/main/java/org/springblade/flow/demo/leave/service/impl/LeaveTestServiceImpl.java
deleted file mode 100644
index f9cdf69..0000000
--- a/src/main/java/org/springblade/flow/demo/leave/service/impl/LeaveTestServiceImpl.java
+++ /dev/null
@@ -1,79 +0,0 @@
-///*
-// * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
-// *
-// * Redistribution and use in source and binary forms, with or without
-// * modification, are permitted provided that the following conditions are met:
-// *
-// * Redistributions of source code must retain the above copyright notice,
-// * this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// * notice, this list of conditions and the following disclaimer in the
-// * documentation and/or other materials provided with the distribution.
-// * Neither the name of the dreamlu.net developer nor the names of its
-// * contributors may be used to endorse or promote products derived from
-// * this software without specific prior written permission.
-// * Author: Chill 庄骞 (smallchill@163.com)
-// */
-//package org.springblade.flow.demo.leave.service.impl;
-//
-//import lombok.AllArgsConstructor;
-//import lombok.extern.slf4j.Slf4j;
-//import org.springblade.core.log.exception.ServiceException;
-//import org.springblade.core.mp.base.BaseServiceImpl;
-//import org.springblade.core.secure.utils.AuthUtil;
-//import org.springblade.core.tool.support.Kv;
-//import org.springblade.core.tool.utils.DateUtil;
-//import org.springblade.core.tool.utils.Func;
-//import org.springblade.flow.business.service.IFlowService;
-//import org.springblade.flow.core.constant.ProcessConstant;
-//import org.springblade.flow.core.entity.BladeFlow;
-//import org.springblade.flow.core.utils.FlowUtil;
-//import org.springblade.flow.core.utils.TaskUtil;
-//import org.springblade.flow.demo.leave.entity.ProcessLeave;
-//import org.springblade.flow.demo.leave.mapper.LeaveMapper;
-//import org.springblade.flow.demo.leave.service.ILeaveService;
-//import org.springframework.stereotype.Service;
-//import org.springframework.transaction.annotation.Transactional;
-//
-///**
-// * 服务实现类
-// *
-// * @author Chill
-// */
-//@Slf4j
-//@Service
-//@AllArgsConstructor
-//public class LeaveServiceImpl extends BaseServiceImpl<LeaveMapper, ProcessLeave> implements ILeaveService {
-//
-// private final IFlowService flowService;
-//
-// @Override
-// @Transactional(rollbackFor = Exception.class)
-// public boolean startProcess(ProcessLeave leave) {
-// String businessTable = FlowUtil.getBusinessTable(ProcessConstant.LEAVE_KEY);
-// if (Func.isEmpty(leave.getId())) {
-// // 保存leave
-// leave.setApplyTime(DateUtil.now());
-// save(leave);
-// // 启动流程
-// Kv variables = Kv.create()
-// .set(ProcessConstant.TASK_VARIABLE_CREATE_USER, AuthUtil.getUserName())
-// .set("taskUser", TaskUtil.getTaskUser(leave.getTaskUser()))
-// .set("days", DateUtil.between(leave.getStartTime(), leave.getEndTime()).toDays());
-// BladeFlow flow = flowService.startProcessInstanceById(leave.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(leave.getId())), variables);
-// if (Func.isNotEmpty(flow)) {
-// log.debug("流程已启动,流程ID:" + flow.getProcessInstanceId());
-// // 返回流程id写入leave
-// leave.setProcessInstanceId(flow.getProcessInstanceId());
-// updateById(leave);
-// } else {
-// throw new ServiceException("开启流程失败");
-// }
-// } else {
-//
-// updateById(leave);
-// }
-// return true;
-// }
-//
-//}
diff --git a/src/main/java/org/springblade/modules/leave/controller/LeaveController.java b/src/main/java/org/springblade/modules/leave/controller/LeaveController.java
deleted file mode 100644
index 5772fab..0000000
--- a/src/main/java/org/springblade/modules/leave/controller/LeaveController.java
+++ /dev/null
@@ -1,91 +0,0 @@
-
-package org.springblade.modules.leave.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.ApiParam;
-import lombok.AllArgsConstructor;
-import org.springblade.core.boot.ctrl.BladeController;
-import org.springblade.core.mp.support.Condition;
-import org.springblade.core.mp.support.Query;
-import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.modules.leave.entity.Leave;
-import org.springblade.modules.leave.service.LeaveService;
-import org.springblade.modules.leave.vo.LeaveVO;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * 请假控制器
- * @author zhongrj
- * @since 2022-02-28
- */
-@RestController
-@AllArgsConstructor
-@RequestMapping("/leave")
-public class LeaveController extends BladeController {
-
- private final LeaveService leaveService;
-
- /**
- * 详情
- */
- @GetMapping("/detail")
- public R<Leave> detail(Leave leave) {
- Leave detail = leaveService.getOne(Condition.getQueryWrapper(leave));
- return R.data(detail);
- }
-
- /**
- * 分页
- */
- @GetMapping("/list")
- public R<IPage<Leave>> list(Leave leave, Query query) {
- IPage<Leave> pages = leaveService.page(Condition.getPage(query), Condition.getQueryWrapper(leave));
- return R.data(pages);
- }
-
- /**
- * 自定义分页
- */
- @GetMapping("/page")
- public R<IPage<LeaveVO>> page(LeaveVO leave, Query query) {
- IPage<LeaveVO> pages = leaveService.selectLeavePage(Condition.getPage(query), leave);
- return R.data(pages);
- }
-
- /**
- * 新增
- */
- @PostMapping("/save")
- public R save(@RequestBody Leave leave) {
- return R.data(leaveService.save(leave));
- }
-
-
- /**
- * 修改
- */
- @PostMapping("/update")
- public R update(@RequestBody Leave leave) {
- return R.data(leaveService.updateById(leave));
- }
-
- /**
- * 新增或修改
- */
- @PostMapping("/submit")
- public R submit(@RequestBody Leave leave) {
- return R.status(leaveService.saveOrUpdate(leave));
- }
-
-
- /**
- * 删除
- */
- @PostMapping("/remove")
- public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
- return R.status(leaveService.removeByIds(Func.toLongList(ids)));
- }
-
-
-}
diff --git a/src/main/java/org/springblade/modules/leave/entity/Leave.java b/src/main/java/org/springblade/modules/leave/entity/Leave.java
deleted file mode 100644
index 136ae46..0000000
--- a/src/main/java/org/springblade/modules/leave/entity/Leave.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.springblade.modules.leave.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * 请假实体类
- *
- * @author zhongrj
- * @since 2020-02-28
- */
-@Data
-@TableName("sys_leave")
-public class Leave implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 主键id
- */
- @TableId(value = "id",type = IdType.AUTO)
- private Long id;
-
- /**
- * 用户id
- */
- private Long userId;
-
- /**
- * 请假类型
- */
- private Integer leaveType;
-
- /**
- * 请假原因
- */
- private String leaveReason;
-
- /**
- * 请假开始时间
- */
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private Date startTime;
-
- /**
- * 请假截止时间
- */
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private Date endTime;
-
- /**
- * 创建时间
- */
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private Date createTime;
-
- /**
- * 审核状态 1:通过 2:不通过 3:待审核
- */
- private Integer auditStatus;
-
- /**
- * 审核明细
- */
- private String auditDetail;
-
- /**
- * 审核时间
- */
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private Date auditTime;
-
-}
diff --git a/src/main/java/org/springblade/modules/leave/mapper/LeaveMapper.java b/src/main/java/org/springblade/modules/leave/mapper/LeaveMapper.java
deleted file mode 100644
index 2ab23de..0000000
--- a/src/main/java/org/springblade/modules/leave/mapper/LeaveMapper.java
+++ /dev/null
@@ -1,28 +0,0 @@
-
-package org.springblade.modules.leave.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.apache.ibatis.annotations.Param;
-import org.springblade.modules.leave.entity.Leave;
-import org.springblade.modules.leave.vo.LeaveVO;
-
-import java.util.List;
-
-/**
- * Mapper 接口
- *
- * @author zhongrj
- * @since 2022-02-21
- */
-public interface LeaveMapper extends BaseMapper<Leave> {
-
- /**
- * 自定义分页
- *
- * @param page
- * @param leave
- * @return
- */
- List<LeaveVO> selectLeavePage(IPage<LeaveVO> page, @Param("leave") LeaveVO leave);
-}
diff --git a/src/main/java/org/springblade/modules/leave/mapper/LeaveMapper.xml b/src/main/java/org/springblade/modules/leave/mapper/LeaveMapper.xml
deleted file mode 100644
index 645b044..0000000
--- a/src/main/java/org/springblade/modules/leave/mapper/LeaveMapper.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.springblade.modules.leave.mapper.LeaveMapper">
-
- <!--自定义查询请假分页数据-->
- <select id="selectLeavePage" resultType="org.springblade.modules.leave.vo.LeaveVO">
- select * from sys_leave
- where 1=1
- <if test="leave.userId!=null">
- and user_id = #{leave.idCardNo}
- </if>
- </select>
-
-</mapper>
diff --git a/src/main/java/org/springblade/modules/leave/service/LeaveService.java b/src/main/java/org/springblade/modules/leave/service/LeaveService.java
deleted file mode 100644
index 3106c05..0000000
--- a/src/main/java/org/springblade/modules/leave/service/LeaveService.java
+++ /dev/null
@@ -1,27 +0,0 @@
-
-package org.springblade.modules.leave.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.apache.ibatis.annotations.Param;
-import org.springblade.modules.leave.entity.Leave;
-import org.springblade.modules.leave.vo.LeaveVO;
-
-/**
- * 请假服务类
- *
- * @author zhongrj
- * @since 2022-02-28
- */
-public interface LeaveService extends IService<Leave> {
-
- /**
- * 自定义分页
- *
- * @param page
- * @param leaveVO
- * @return
- */
- IPage<LeaveVO> selectLeavePage(IPage<LeaveVO> page, @Param("leaveVO") LeaveVO leaveVO);
-
-}
diff --git a/src/main/java/org/springblade/modules/leave/service/impl/LeaveServiceImpl.java b/src/main/java/org/springblade/modules/leave/service/impl/LeaveServiceImpl.java
deleted file mode 100644
index 7d0ae11..0000000
--- a/src/main/java/org/springblade/modules/leave/service/impl/LeaveServiceImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-
-package org.springblade.modules.leave.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springblade.modules.leave.entity.Leave;
-import org.springblade.modules.leave.mapper.LeaveMapper;
-import org.springblade.modules.leave.service.LeaveService;
-import org.springblade.modules.leave.vo.LeaveVO;
-import org.springframework.stereotype.Service;
-
-/**
- * 请假服务实现类
- *
- * @author zhongrj
- * @since 2022-02-28
- */
-@Service
-public class LeaveServiceImpl extends ServiceImpl<LeaveMapper, Leave> implements LeaveService {
-
- /**
- * 自定义分页查询用户会员数据
- * @param page
- * @param leave
- * @return
- */
- @Override
- public IPage<LeaveVO> selectLeavePage(IPage<LeaveVO> page, LeaveVO leave) {
- return page.setRecords(baseMapper.selectLeavePage(page, leave));
- }
-}
diff --git a/src/main/java/org/springblade/modules/leave/vo/LeaveVO.java b/src/main/java/org/springblade/modules/leave/vo/LeaveVO.java
deleted file mode 100644
index bbe1cd5..0000000
--- a/src/main/java/org/springblade/modules/leave/vo/LeaveVO.java
+++ /dev/null
@@ -1,15 +0,0 @@
-
-package org.springblade.modules.leave.vo;
-
-import lombok.Data;
-import org.springblade.modules.leave.entity.Leave;
-
-/**
- * 视图实体类
- * @author zhongrj
- * @since 2022-02-21
- */
-@Data
-public class LeaveVO extends Leave {
- private static final long serialVersionUID = 1L;
-}
--
Gitblit v1.9.3