代码提交 请假 出差
This commit is contained in:
parent
982b428919
commit
485f015c06
@ -0,0 +1,88 @@
|
|||||||
|
package org.dromara.workflow.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差对象 lx_oa_business_trip
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2023-07-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("lx_oa_business_trip")
|
||||||
|
public class LxOaBusinessTrip extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型
|
||||||
|
*/
|
||||||
|
private String tripType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差天数
|
||||||
|
*/
|
||||||
|
private Integer tripDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅金额
|
||||||
|
*/
|
||||||
|
private BigDecimal tripMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差原因
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在办项目
|
||||||
|
*/
|
||||||
|
private String currentProjects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件
|
||||||
|
*/
|
||||||
|
private String attachment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预算事项
|
||||||
|
*/
|
||||||
|
private String budgetType;
|
||||||
|
|
||||||
|
}
|
@ -10,7 +10,7 @@ import java.io.Serial;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请假对象 test_leave
|
* 请假对象 lx_oa_leave
|
||||||
*
|
*
|
||||||
* @author may
|
* @author may
|
||||||
* @date 2023-07-21
|
* @date 2023-07-21
|
||||||
@ -74,5 +74,4 @@ public class LxOaLeave extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,110 @@
|
|||||||
|
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;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
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.LxOaBusinessTrip;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差业务对象 lx_oa_business_trip
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2023-07-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = LxOaBusinessTrip.class, reverseConvertGenerate = false)
|
||||||
|
public class LxOaBusinessTripBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请假类型
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "请假类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String leaveType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "开始时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "结束时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请假天数
|
||||||
|
*/
|
||||||
|
private Integer leaveDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Integer startLeaveDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Integer endLeaveDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请假原因
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "出差原因")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在办项目
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "在办项目")
|
||||||
|
private String currentProjects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "附件")
|
||||||
|
private String attachment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预算事项
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "预算事项")
|
||||||
|
private String budgetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门
|
||||||
|
*/
|
||||||
|
private String dept;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -15,7 +15,7 @@ import org.dromara.workflow.domain.LxOaLeave;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请假业务对象 test_leave
|
* 请假业务对象 lx_oa_leave
|
||||||
*
|
*
|
||||||
* @author may
|
* @author may
|
||||||
* @date 2023-07-21
|
* @date 2023-07-21
|
||||||
|
@ -0,0 +1,101 @@
|
|||||||
|
package org.dromara.workflow.domain.vo;
|
||||||
|
|
||||||
|
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.LxOaBusinessTrip;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差视图对象 lx_oa_business_trip
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2023-07-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = LxOaBusinessTrip.class)
|
||||||
|
public class LxOaBusinessTripVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "业务类型")
|
||||||
|
private String tripType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "开始时间")
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "结束时间")
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差天数
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "出差天数")
|
||||||
|
private Integer tripDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅金额
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "差旅金额")
|
||||||
|
private BigDecimal tripMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请假原因
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "出差原因")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在办项目
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "在办项目")
|
||||||
|
private String currentProjects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预算事项
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "预算事项")
|
||||||
|
private String budgetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "附件")
|
||||||
|
private String attachment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
@ -12,7 +12,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请假视图对象 test_leave
|
* 请假视图对象 lx_oa_leave
|
||||||
*
|
*
|
||||||
* @author may
|
* @author may
|
||||||
* @date 2023-07-21
|
* @date 2023-07-21
|
||||||
|
@ -150,7 +150,7 @@ public class LxOaLeaveServiceImpl implements ILxOaLeaveService {
|
|||||||
*
|
*
|
||||||
* @param processEvent 参数
|
* @param processEvent 参数
|
||||||
*/
|
*/
|
||||||
@EventListener(condition = "#processEvent.flowCode.startsWith('leave')")
|
@EventListener(condition = "#processEvent.flowCode=='leave1'")
|
||||||
public void processHandler(ProcessEvent processEvent) {
|
public void processHandler(ProcessEvent processEvent) {
|
||||||
log.info("当前任务执行了{}", processEvent.toString());
|
log.info("当前任务执行了{}", processEvent.toString());
|
||||||
LxOaLeave lxOaLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessId()));
|
LxOaLeave lxOaLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessId()));
|
||||||
@ -167,6 +167,7 @@ public class LxOaLeaveServiceImpl implements ILxOaLeaveService {
|
|||||||
}
|
}
|
||||||
if (processEvent.isSubmit()) {
|
if (processEvent.isSubmit()) {
|
||||||
lxOaLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
lxOaLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||||
|
|
||||||
}
|
}
|
||||||
baseMapper.updateById(lxOaLeave);
|
baseMapper.updateById(lxOaLeave);
|
||||||
}
|
}
|
||||||
|
@ -19,14 +19,12 @@ import org.dromara.common.core.utils.StringUtils;
|
|||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.warm.flow.core.entity.Instance;
|
|
||||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||||
import org.dromara.workflow.domain.TestLeave;
|
import org.dromara.workflow.domain.TestLeave;
|
||||||
import org.dromara.workflow.domain.bo.TestLeaveBo;
|
import org.dromara.workflow.domain.bo.TestLeaveBo;
|
||||||
import org.dromara.workflow.domain.vo.TestLeaveVo;
|
import org.dromara.workflow.domain.vo.TestLeaveVo;
|
||||||
import org.dromara.workflow.mapper.TestLeaveMapper;
|
import org.dromara.workflow.mapper.TestLeaveMapper;
|
||||||
import org.dromara.workflow.service.ITestLeaveService;
|
import org.dromara.workflow.service.ITestLeaveService;
|
||||||
import org.springframework.context.event.EventListener;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -145,12 +143,12 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
* 正常使用只需#processEvent.flowCode=='leave11'
|
||||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||||
*
|
*
|
||||||
* @param processEvent 参数
|
* @param processEvent 参数
|
||||||
*/
|
*/
|
||||||
@EventListener(condition = "#processEvent.flowCode.startsWith('leave')")
|
// @EventListener(condition = "#processEvent.flowCode.startsWith('leave11')")
|
||||||
public void processHandler(ProcessEvent processEvent) {
|
public void processHandler(ProcessEvent processEvent) {
|
||||||
log.info("当前任务执行了{}", processEvent.toString());
|
log.info("当前任务执行了{}", processEvent.toString());
|
||||||
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessId()));
|
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessId()));
|
||||||
@ -181,7 +179,7 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
|||||||
*
|
*
|
||||||
* @param processCreateTaskEvent 参数
|
* @param processCreateTaskEvent 参数
|
||||||
*/
|
*/
|
||||||
@EventListener(condition = "#processCreateTaskEvent.flowCode.startsWith('leave')")
|
// @EventListener(condition = "#processCreateTaskEvent.flowCode.startsWith('leave1')")
|
||||||
public void processCreateTaskHandler(ProcessCreateTaskEvent processCreateTaskEvent) {
|
public void processCreateTaskHandler(ProcessCreateTaskEvent processCreateTaskEvent) {
|
||||||
log.info("当前任务创建了{}", processCreateTaskEvent.toString());
|
log.info("当前任务创建了{}", processCreateTaskEvent.toString());
|
||||||
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processCreateTaskEvent.getBusinessId()));
|
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processCreateTaskEvent.getBusinessId()));
|
||||||
@ -196,7 +194,7 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
|||||||
*
|
*
|
||||||
* @param processDeleteEvent 参数
|
* @param processDeleteEvent 参数
|
||||||
*/
|
*/
|
||||||
@EventListener(condition = "#processDeleteEvent.flowCode.startsWith('leave')")
|
// @EventListener(condition = "#processDeleteEvent.flowCode.startsWith('leave1')")
|
||||||
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
|
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||||
log.info("监听删除流程事件,当前任务执行了{}", processDeleteEvent.toString());
|
log.info("监听删除流程事件,当前任务执行了{}", processDeleteEvent.toString());
|
||||||
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processDeleteEvent.getBusinessId()));
|
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processDeleteEvent.getBusinessId()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user