代码提交 请假

This commit is contained in:
123 2025-05-14 14:31:54 +08:00
parent 664af6028f
commit 982b428919
5 changed files with 66 additions and 12 deletions

View File

@ -42,7 +42,7 @@ public class OABusinessTripController extends BaseController {
/**
* 查询出差列表
*/
@SaCheckPermission("workflow:leave:list")
@SaCheckPermission("workflow:trip:list")
@GetMapping("/list")
public TableDataInfo<TestLeaveVo> list(TestLeaveBo bo, PageQuery pageQuery) {
return testLeaveService.queryPageList(bo, pageQuery);
@ -51,7 +51,7 @@ public class OABusinessTripController extends BaseController {
/**
* 导出请假列表
*/
@SaCheckPermission("workflow:leave:export")
@SaCheckPermission("workflow:trip:export")
@Log(title = "请假", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(TestLeaveBo bo, HttpServletResponse response) {
@ -64,7 +64,7 @@ public class OABusinessTripController extends BaseController {
*
* @param id 主键
*/
@SaCheckPermission("workflow:leave:query")
@SaCheckPermission("workflow:trip:query")
@GetMapping("/{id}")
public R<TestLeaveVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
@ -74,7 +74,7 @@ public class OABusinessTripController extends BaseController {
/**
* 新增请假
*/
@SaCheckPermission("workflow:leave:add")
@SaCheckPermission("workflow:trip:add")
@Log(title = "请假", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@ -85,7 +85,7 @@ public class OABusinessTripController extends BaseController {
/**
* 修改请假
*/
@SaCheckPermission("workflow:leave:edit")
@SaCheckPermission("workflow:trip:edit")
@Log(title = "请假", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@ -98,7 +98,7 @@ public class OABusinessTripController extends BaseController {
*
* @param ids 主键串
*/
@SaCheckPermission("workflow:leave:remove")
@SaCheckPermission("workflow:trip:remove")
@Log(title = "请假", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@ -52,8 +52,23 @@ public class LxOaLeave extends BaseEntity {
/**
* 请假原因
*/
private String reason;
/**
* 备注
*/
private String remark;
/**
* 在办项目
*/
private String currentProjects;
/**
* 附件
*/
private String attachment;
/**
* 状态
*/

View File

@ -1,5 +1,6 @@
package org.dromara.workflow.domain.bo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
@ -9,7 +10,7 @@ import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.workflow.domain.TestLeave;
import org.dromara.workflow.domain.LxOaLeave;
import java.util.Date;
@ -21,7 +22,7 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = TestLeave.class, reverseConvertGenerate = false)
@AutoMapper(target = LxOaLeave.class, reverseConvertGenerate = false)
public class LxOaLeaveBo extends BaseEntity {
/**
@ -68,8 +69,27 @@ public class LxOaLeaveBo extends BaseEntity {
/**
* 请假原因
*/
@ExcelProperty(value = "请假原因")
private String reason;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
/**
* 在办项目
*/
@ExcelProperty(value = "在办项目")
private String currentProjects;
/**
* 附件
*/
@ExcelProperty(value = "附件")
private String attachment;
/**
* 状态
*/

View File

@ -4,7 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.workflow.domain.TestLeave;
import org.dromara.workflow.domain.LxOaLeave;
import java.io.Serial;
import java.io.Serializable;
@ -19,7 +19,7 @@ import java.util.Date;
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = TestLeave.class)
@AutoMapper(target = LxOaLeave.class)
public class LxOaLeaveVo implements Serializable {
@Serial
@ -56,11 +56,29 @@ public class LxOaLeaveVo implements Serializable {
private Integer leaveDays;
/**
* 备注
* 请假原因
*/
@ExcelProperty(value = "请假原因")
private String reason;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
/**
* 在办项目
*/
@ExcelProperty(value = "在办项目")
private String currentProjects;
/**
* 附件
*/
@ExcelProperty(value = "附件")
private String attachment;
/**
* 状态
*/

View File

@ -1,6 +1,7 @@
package org.dromara.workflow.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
@ -102,7 +103,7 @@ public class LxOaLeaveServiceImpl implements ILxOaLeaveService {
*/
@Override
public LxOaLeaveVo insertByBo(LxOaLeaveBo bo) {
long day = DateUtil.betweenDay(bo.getStartDate(), bo.getEndDate(), true);
long day = DateUtil.between(bo.getStartDate(), bo.getEndDate(), DateUnit.DAY);
// 截止日期也算一天
bo.setLeaveDays((int) day + 1);
LxOaLeave add = MapstructUtils.convert(bo, LxOaLeave.class);