离职申请单开发
This commit is contained in:
parent
fea559d590
commit
e0e90d5475
|
@ -0,0 +1,211 @@
|
|||
package com.snow.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.snow.common.annotation.RepeatSubmit;
|
||||
import com.snow.common.constant.SequenceContants;
|
||||
import com.snow.flowable.domain.CompleteTaskDTO;
|
||||
import com.snow.flowable.domain.resign.SysOaResignTask;
|
||||
import com.snow.flowable.domain.resign.SysOaResignForm;
|
||||
import com.snow.flowable.service.FlowableService;
|
||||
import com.snow.flowable.service.FlowableTaskService;
|
||||
import com.snow.framework.util.ShiroUtils;
|
||||
import com.snow.system.domain.SysUser;
|
||||
import com.snow.system.service.ISysSequenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.snow.common.annotation.Log;
|
||||
import com.snow.common.enums.BusinessType;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.snow.system.domain.SysOaResign;
|
||||
import com.snow.system.service.ISysOaResignService;
|
||||
import com.snow.common.core.controller.BaseController;
|
||||
import com.snow.common.core.domain.AjaxResult;
|
||||
import com.snow.common.utils.poi.ExcelUtil;
|
||||
import com.snow.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 离职申请单Controller
|
||||
*
|
||||
* @author 没用的阿吉
|
||||
* @date 2021-03-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/resign")
|
||||
public class SysOaResignController extends BaseController
|
||||
{
|
||||
private String prefix = "system/signature";
|
||||
|
||||
@Autowired
|
||||
private ISysOaResignService sysOaResignService;
|
||||
|
||||
@Autowired
|
||||
private ISysSequenceService sequenceService;
|
||||
|
||||
@Autowired
|
||||
private FlowableService flowableService;
|
||||
|
||||
@Autowired
|
||||
private FlowableTaskService flowableTaskService;
|
||||
|
||||
@RequiresPermissions("system:resign:view")
|
||||
@GetMapping()
|
||||
public String resign()
|
||||
{
|
||||
return prefix + "/resign";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询离职申请单列表
|
||||
*/
|
||||
@RequiresPermissions("system:resign:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SysOaResign sysOaResign)
|
||||
{
|
||||
startPage();
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
//管理员权限判断
|
||||
if(!ShiroUtils.getSysUser().isAdmin()){
|
||||
sysOaResign.setApplyPerson(String.valueOf(sysUser.getUserId()));
|
||||
}
|
||||
List<SysOaResign> list = sysOaResignService.selectSysOaResignList(sysOaResign);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出离职申请单列表
|
||||
*/
|
||||
@RequiresPermissions("system:resign:export")
|
||||
@Log(title = "离职申请单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SysOaResign sysOaResign)
|
||||
{
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
//管理员权限判断
|
||||
if(!ShiroUtils.getSysUser().isAdmin()){
|
||||
sysOaResign.setApplyPerson(String.valueOf(sysUser.getUserId()));
|
||||
}
|
||||
List<SysOaResign> list = sysOaResignService.selectSysOaResignList(sysOaResign);
|
||||
ExcelUtil<SysOaResign> util = new ExcelUtil<SysOaResign>(SysOaResign.class);
|
||||
return util.exportExcel(list, "resign");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增离职申请单
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap mmap)
|
||||
{
|
||||
String newSequenceNo = sequenceService.getNewSequenceNo(SequenceContants.OA_RESIGN_SEQUENCE);
|
||||
mmap.put("resignNo", newSequenceNo);
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存离职申请单
|
||||
*/
|
||||
@RequiresPermissions("system:resign:add")
|
||||
@Log(title = "离职申请单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(SysOaResign sysOaResign)
|
||||
{
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
sysOaResign.setCreateBy(String.valueOf(sysUser.getUserId()));
|
||||
sysOaResign.setApplyPerson(String.valueOf(sysUser.getUserId()));
|
||||
sysOaResign.setUpdateBy(String.valueOf(sysUser.getUserId()));
|
||||
return toAjax(sysOaResignService.insertSysOaResign(sysOaResign));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改离职申请单
|
||||
*/
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Integer id, ModelMap mmap)
|
||||
{
|
||||
SysOaResign sysOaResign = sysOaResignService.selectSysOaResignById(id);
|
||||
mmap.put("sysOaResign", sysOaResign);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改离职申请单并发起申请
|
||||
*/
|
||||
@RequiresPermissions("system:resign:edit")
|
||||
@Log(title = "离职申请单", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@RepeatSubmit
|
||||
public AjaxResult editSave(SysOaResign sysOaResign)
|
||||
{
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
sysOaResign.setUpdateBy(String.valueOf(sysUser.getUserId()));
|
||||
int i = sysOaResignService.updateSysOaResign(sysOaResign);
|
||||
SysOaResign newSysOaResign = sysOaResignService.selectSysOaResignById(sysOaResign.getId());
|
||||
//发起审批
|
||||
SysOaResignForm sysOaResignForm=new SysOaResignForm();
|
||||
BeanUtils.copyProperties(newSysOaResign,sysOaResignForm);
|
||||
sysOaResignForm.setBusinessKey(sysOaResignForm.getResignNo());
|
||||
sysOaResignForm.setStartUserId(String.valueOf(sysUser.getUserId()));
|
||||
sysOaResignForm.setBusVarUrl("/system/sysOaResign/detail");
|
||||
ProcessInstance processInstance = flowableService.startProcessInstanceByAppForm(sysOaResignForm);
|
||||
//推进任务节点
|
||||
flowableTaskService.automaticTask(processInstance.getProcessInstanceId());
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除离职申请单
|
||||
*/
|
||||
@RequiresPermissions("system:resign:remove")
|
||||
@Log(title = "离职申请单", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(sysOaResignService.deleteSysOaResignByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 详情页
|
||||
*/
|
||||
@GetMapping("/detail/{id}")
|
||||
public String detail(@PathVariable("id") Integer id, ModelMap mmap)
|
||||
{
|
||||
SysOaResign sysOaResign = sysOaResignService.selectSysOaResignById(id);
|
||||
mmap.put("sysOaResign", sysOaResign);
|
||||
return prefix + "/detail";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 重新申请
|
||||
*/
|
||||
@PostMapping("/restart")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@RepeatSubmit
|
||||
public AjaxResult restart(SysOaResignTask sysOaResignTask)
|
||||
{
|
||||
SysOaResign sysOaResign=new SysOaResign();
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
sysOaResign.setUpdateBy(String.valueOf(sysUser.getUserId()));
|
||||
BeanUtils.copyProperties(sysOaResignTask,sysOaResign);
|
||||
int i = sysOaResignService.updateSysOaResign(sysOaResign);
|
||||
flowableTaskService.submitTask(sysOaResignTask);
|
||||
return toAjax(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增离职申请单')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-resign-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="resignNo" class="form-control" type="text" th:value="${resignNo}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="resignType" class="form-control m-b" th:with="type=${@dict.getType('sys_resign_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{resignType}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="name" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职理由:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="reason" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职去向:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="resignPlaceGo" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">交接人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="transitionPerson" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="resignTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="resignType" class="form-control m-b" th:with="type=${@dict.getType('sys_resign_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">附件:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" name="fileUrl">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="fileUrl" name="file" type="file">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/resign"
|
||||
$("#form-resign-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-resign-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='resignTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$(".file-upload").fileinput({
|
||||
uploadUrl: '/common/upload',
|
||||
maxFileCount: 1,
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,158 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" />
|
||||
<!-- bootstrap-table 表格插件样式 -->
|
||||
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/animate.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/style.css}" rel="stylesheet" />
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css}" rel="stylesheet" />
|
||||
<th:block th:include="include :: jsonview-css" />
|
||||
|
||||
</head>
|
||||
<body class="white-bg" >
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<input name="id" th:value="${purchaseOrder.id}" type="hidden">
|
||||
<h2 class="form-header h2" align="center" >采购单信息</h2>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-5 col-md-offset-1">
|
||||
<label>单号:</label>
|
||||
<span th:text="${purchaseOrder.orderNo}"/>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-6">
|
||||
<label>采购标题:</label>
|
||||
<span th:text="${purchaseOrder.title}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label>供应商:</label>
|
||||
<span th:text="${purchaseOrder.supplierName}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >订货日期:</label>
|
||||
<span th:text="${#dates.format(purchaseOrder.orderTime, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label>交货日期:</label>
|
||||
<span th:text="${#dates.format(purchaseOrder.deliveryDate, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label >采购人:</label>
|
||||
<span th:text="${purchaseOrder.belongUser}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >总数量:</label>
|
||||
<span th:text="${purchaseOrder.totalQuantity}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >总金额:</label>
|
||||
<span th:text="${purchaseOrder.totalPrice}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-sm-10 col-md-offset-1">
|
||||
<label>备注:</label>
|
||||
<span th:text="${purchaseOrder.remark}"/>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-header h4">采购单明细</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<!-- <th:block th:include="include :: jsonview-js" />-->
|
||||
<script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js"></script>
|
||||
<script th:src="@{/js/jquery.jqprint-0.3.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
|
||||
function printData(){
|
||||
$("#signupForm").jqprint({
|
||||
debug: false,
|
||||
importCSS: true,
|
||||
printContainer: true,
|
||||
operaSupport: false
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
var reason = [[${purchaseOrder.remark}]];
|
||||
console.log(reason);
|
||||
if ($.common.isNotEmpty(reason) && reason.length < 2000) {
|
||||
$("#reason").text(reason);
|
||||
} else {
|
||||
$("#reason").text(reason);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
data: [[${purchaseOrder.purchaseOrderItemList}]],
|
||||
pagination: false,
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
sidePagination: "client",
|
||||
columns: [
|
||||
{
|
||||
field: 'index',
|
||||
align: 'center',
|
||||
title: "序号",
|
||||
formatter: function (value, row, index) {
|
||||
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
|
||||
return columnIndex + $.table.serialNumber(index);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'goodsNo',
|
||||
align: 'center',
|
||||
title: '货物编号'
|
||||
},
|
||||
{
|
||||
field: 'goodsName',
|
||||
align: 'center',
|
||||
title: '名称'
|
||||
},
|
||||
{
|
||||
field: 'goodsSize',
|
||||
align: 'center',
|
||||
title: '规格'
|
||||
},
|
||||
{
|
||||
field: 'goodsQuantity',
|
||||
align: 'center',
|
||||
title: '数量'
|
||||
},
|
||||
{
|
||||
field: 'goodsPrice',
|
||||
align: 'center',
|
||||
title: '单价'
|
||||
},
|
||||
{
|
||||
field: 'totalPrice',
|
||||
align: 'center',
|
||||
title: '总价'
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
align: 'center',
|
||||
title: '备注'
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,109 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改离职申请单')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-resign-edit" th:object="${sysOaResign}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="resignNo" th:field="*{resignNo}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="resignType" class="form-control m-b" th:with="type=${@dict.getType('sys_resign_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{resignType}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="name" th:field="*{name}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职理由:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="reason" class="form-control">[[*{reason}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职去向:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="resignPlaceGo" th:field="*{resignPlaceGo}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">交接人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="transitionPerson" th:field="*{transitionPerson}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">离职时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="resignTime" th:value="${#dates.format(sysOaResign.resignTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">附件:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" name="fileUrl" th:field="*{fileUrl}">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="fileUrl" name="file" type="file">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/resign";
|
||||
$("#form-resign-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-resign-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='resignTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$(".file-upload").each(function (i) {
|
||||
var val = $("input[name='" + this.id + "']").val()
|
||||
$(this).fileinput({
|
||||
'uploadUrl': '/common/upload',
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: [val],
|
||||
maxFileCount: 1,
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
$(this).fileinput('_initFileActions');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,143 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" />
|
||||
<!-- bootstrap-table 表格插件样式 -->
|
||||
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/animate.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/style.css}" rel="stylesheet" />
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css}" rel="stylesheet" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg" >
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<input class="form-control" type="hidden" name="taskId" th:value="*{taskId}"/>
|
||||
<input class="form-control" type="hidden" id="processInstanceId" name="processInstanceId" th:value="*{processInstanceId}"/>
|
||||
<input class="form-control" type="hidden" name="businessKey" th:value="${appFrom.resignNo}"/>
|
||||
<input name="id" th:value="${appFrom.id}" type="hidden">
|
||||
<br/>
|
||||
<h2 class="form-header h2" >离职申请信息</h2>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label>单号:</label>
|
||||
<span th:text="${appFrom.resignNo}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label>标题:</label>
|
||||
<span th:text="${appFrom.name}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label>离职去向:</label>
|
||||
<span th:text="${appFrom.resignPlaceGo}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >离职日期:</label>
|
||||
<span th:text="${#dates.format(appFrom.resignTime, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
<!--<div class="col-xs-3 col-sm-3">
|
||||
<label>提交日期:</label>
|
||||
<span th:text="${#dates.format(appFrom.createTime, 'yyyy-MM-dd')}"/>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label >交接人:</label>
|
||||
<span th:text="${appFrom.transitionPerson}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-sm-10 col-md-offset-1">
|
||||
<label>离职理由:</label>
|
||||
<span th:text="${appFrom.reason}"/>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<h4 class="form-header h4">流程图</h4>
|
||||
<div class="vertical-timeline-block" >
|
||||
<img class="imgcode" width="85%"/>
|
||||
</div>
|
||||
<h4 class="form-header h4">填写信息</h4>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审批结果:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('process_check_status')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="isPass" th:value="${dict.dictValue}" required>
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审批意见:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="comment" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审批附件:</label>
|
||||
<div class="col-sm-8">
|
||||
<!--<input type="hidden" name="files" >-->
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="files" name="file" type="file" multiple>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-6 col-sm-10">
|
||||
<button type="button" class="btn btn-sm btn-success" onclick="submitCheckHandler()"><i class="fa fa-check"></i>提 交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
$(function () {
|
||||
var processInstanceId= $("#processInstanceId").val();
|
||||
var url ="/modeler/getProcessDiagram?processInstanceId="+processInstanceId;
|
||||
$(".imgcode").attr("src", url);
|
||||
});
|
||||
var files=new Array();
|
||||
$(".file-upload").each(function (i) {
|
||||
var val = $("input[name='" + this.id + "']").val();
|
||||
$(this).fileinput({
|
||||
'uploadUrl': '/common/upload',
|
||||
initialPreviewAsData: true,
|
||||
allowedFileExtensions: ['jpg', 'gif', 'png',".docx","doc","ppt","pptx","xls","xlsx","vsd","rtf","wps","pdf","txt"],//接收的文件后缀
|
||||
initialPreview: [val],
|
||||
maxFileCount: 1,
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
files.push({"key": data.response.fileKey,"name": data.response.fileName, "url":data.response.url});
|
||||
// $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
$(this).fileinput('_initFileActions');
|
||||
});
|
||||
|
||||
<!--提交审核结果-->
|
||||
function submitCheckHandler() {
|
||||
if ($.validate.form()) {
|
||||
var data = $("#signupForm").serializeArray();
|
||||
for(var i=0;i<data.length;i++){
|
||||
if(data[i].name=='comment'&&(data[i].value==''||data[i].value==null)){
|
||||
$.modal.alertError("请填写审批意见");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(files!=null||files!=''){
|
||||
for(var i=0;i<files.length;i++){
|
||||
data.push({"name": "files["+i+"].key", "value":files[i].key});
|
||||
data.push({"name": "files["+i+"].name", "value":files[i].name});
|
||||
data.push({"name": "files["+i+"].url", "value":files[i].url});
|
||||
}
|
||||
}
|
||||
console.log(data);
|
||||
$.operate.saveTab("/flow/finishTask", data);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,147 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('离职申请单列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>离职单号:</label>
|
||||
<input type="text" name="resignNo"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>离职标题:</label>
|
||||
<input type="text" name="name"/>
|
||||
</li>
|
||||
<li class="select-time">
|
||||
<label>离职时间:</label>
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginResignTime]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endResignTime]"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>离职类型:</label>
|
||||
<select name="resignType" th:with="type=${@dict.getType('sys_resign_type')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>流程状态:</label>
|
||||
<select name="processStatus" th:with="type=${@dict.getType('process_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:resign:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:resign:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:resign:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:resign:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:resign:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:resign:remove')}]];
|
||||
var resignTypeDatas = [[${@dict.getType('sys_resign_type')}]];
|
||||
var processStatusDatas = [[${@dict.getType('process_status')}]];
|
||||
var prefix = ctx + "system/resign";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "离职申请单",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'id',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'resignNo',
|
||||
title: '离职单号'
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '离职标题'
|
||||
},
|
||||
|
||||
{
|
||||
field: 'applyPerson',
|
||||
title: '交接人'
|
||||
},
|
||||
{
|
||||
field: 'resignTime',
|
||||
title: '离职时间'
|
||||
},
|
||||
{
|
||||
field: 'resignType',
|
||||
title: '离职类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(resignTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'processStatus',
|
||||
title: '审批状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(processStatusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
/*if(row.processStatus!=0) {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="printPur(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
|
||||
}*/
|
||||
|
||||
if(row.processStatus==0) {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>发起审批</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
}
|
||||
|
||||
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -8,7 +8,7 @@ package com.snow.common.constant;
|
|||
*/
|
||||
public class SequenceContants {
|
||||
/**
|
||||
*请假
|
||||
*请假单
|
||||
*/
|
||||
public static final String OA_LEAVE_SEQUENCE = "OA_QJ";
|
||||
|
||||
|
@ -16,4 +16,11 @@ public class SequenceContants {
|
|||
* 采购单
|
||||
*/
|
||||
public static final String OA_PURCHASE_SEQUENCE="OA_CG";
|
||||
|
||||
/**
|
||||
* 离职单
|
||||
*/
|
||||
public static final String OA_RESIGN_SEQUENCE="OA_LZ";
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,9 @@ package com.snow.flowable.common.enums;
|
|||
public enum FlowDefEnum {
|
||||
SNOW_OA_LEAVE("snow_oa_leave", "请假申请流程"),
|
||||
|
||||
PURCHASE_ORDER_PROCESS("purchase_order_process", "采购审批流程");
|
||||
PURCHASE_ORDER_PROCESS("purchase_order_process", "采购审批流程"),
|
||||
|
||||
SNOW_OA_RESIGN_PROCESS("snow_oa_resign", "snow系统离职审批流程");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
package com.snow.flowable.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @program: snow
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
package com.snow.flowable.domain.resign;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.snow.flowable.common.enums.FlowDefEnum;
|
||||
import com.snow.flowable.domain.AppForm;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @program: snow
|
||||
* @description
|
||||
* @author: 没用的阿吉
|
||||
* @create: 2021-03-10 21:14
|
||||
**/
|
||||
@Data
|
||||
public class SysOaResignForm extends AppForm implements Serializable {
|
||||
|
||||
/** id */
|
||||
private Integer id;
|
||||
|
||||
/** 离职单号 */
|
||||
private String resignNo;
|
||||
|
||||
/** 离职标题 */
|
||||
private String name;
|
||||
|
||||
/** 离职理由 */
|
||||
private String reason;
|
||||
|
||||
/** 离职去向 */
|
||||
private String resignPlaceGo;
|
||||
|
||||
/** 交接人 */
|
||||
private String transitionPerson;
|
||||
|
||||
/** 离职时间 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date resignTime;
|
||||
|
||||
/** 离职类型(0--自动离职,1-劳动合同期满,2--被辞退,3--其他) */
|
||||
private Integer resignType;
|
||||
|
||||
/** 流程状态(0--待发起,1-审批中,2--审批通过,3--已驳回,4--作废) */
|
||||
private Integer processStatus;
|
||||
|
||||
/** 离职申请人 */
|
||||
private String applyPerson;
|
||||
|
||||
/** 删除标识(0--正常,1--删除) */
|
||||
private Integer isDelete;
|
||||
|
||||
/** 附件 */
|
||||
private String fileUrl;
|
||||
|
||||
@Override
|
||||
public FlowDefEnum getFlowDef() {
|
||||
return FlowDefEnum.SNOW_OA_RESIGN_PROCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*交接人参数
|
||||
*/
|
||||
public static final String TRANSITION_PERSON="transitionPerson";
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.snow.flowable.domain.resign;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.snow.flowable.domain.FinishTaskDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @program: snow
|
||||
* @description
|
||||
* @author: 没用的阿吉
|
||||
* @create: 2021-03-10 21:26
|
||||
**/
|
||||
@Data
|
||||
public class SysOaResignTask extends FinishTaskDTO {
|
||||
/** id */
|
||||
private Integer id;
|
||||
|
||||
/** 离职单号 */
|
||||
private String resignNo;
|
||||
|
||||
/** 离职标题 */
|
||||
private String name;
|
||||
|
||||
/** 离职理由 */
|
||||
private String reason;
|
||||
|
||||
/** 离职去向 */
|
||||
private String resignPlaceGo;
|
||||
|
||||
/** 交接人 */
|
||||
private String transitionPerson;
|
||||
|
||||
/** 离职时间 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date resignTime;
|
||||
|
||||
/** 离职类型(0--自动离职,1-劳动合同期满,2--被辞退,3--其他) */
|
||||
private Integer resignType;
|
||||
|
||||
/** 流程状态(0--待发起,1-审批中,2--审批通过,3--已驳回,4--作废) */
|
||||
private Integer processStatus;
|
||||
|
||||
/** 离职申请人 */
|
||||
private String applyPerson;
|
||||
|
||||
/** 删除标识(0--正常,1--删除) */
|
||||
private Integer isDelete;
|
||||
|
||||
/** 附件 */
|
||||
private String fileUrl;
|
||||
|
||||
/** 创建者 */
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.snow.flowable.listener.resign;
|
||||
|
||||
import com.snow.flowable.domain.resign.SysOaResignForm;
|
||||
import com.snow.flowable.listener.AbstractExecutionListener;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @program: snow
|
||||
* @description
|
||||
* @author: 没用的阿吉
|
||||
* @create: 2021-03-10 23:00
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ManagerSignatureFlowListener extends AbstractExecutionListener<SysOaResignForm> {
|
||||
@Override
|
||||
protected void process() {
|
||||
SysOaResignForm appForms = getAppForms();
|
||||
//设置会签参数
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.snow.flowable.listener.resign;
|
||||
|
||||
import com.snow.common.enums.ProcessStatus;
|
||||
import com.snow.flowable.domain.resign.SysOaResignForm;
|
||||
import com.snow.flowable.listener.AbstractExecutionListener;
|
||||
import com.snow.system.domain.SysOaResign;
|
||||
import com.snow.system.service.impl.SysOaResignServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @program: snow
|
||||
* @description 离职申请开始监听器
|
||||
* @author: 没用的阿吉
|
||||
* @create: 2021-03-10 21:59
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SignatureStartListener extends AbstractExecutionListener<SysOaResignForm> {
|
||||
|
||||
@Autowired
|
||||
private SysOaResignServiceImpl sysOaResignService;
|
||||
|
||||
@Override
|
||||
protected void process() {
|
||||
//获取交接人
|
||||
Object variable = getVariable(SysOaResignForm.TRANSITION_PERSON);
|
||||
//开始的节点是获取不到表单的,因为这个时候流程id是生成了但是由于底层事务的关系,还没有落库。
|
||||
String businessKey= getBusinessKey();
|
||||
SysOaResign sysOaResign=new SysOaResign();
|
||||
sysOaResign.setProcessStatus(ProcessStatus.CHECKING.ordinal());
|
||||
sysOaResign.setResignNo(businessKey);
|
||||
//设置交际人参数
|
||||
setVariable(SysOaResignForm.TRANSITION_PERSON,variable);
|
||||
sysOaResignService.updateSysOaResignByResignNo(sysOaResign);
|
||||
}
|
||||
}
|
|
@ -251,6 +251,7 @@ public class FlowableTaskServiceImpl implements FlowableTaskService {
|
|||
Task task=flowableService.getTaskProcessInstanceById(processInstanceId);
|
||||
completeTaskDTO.setTaskId(task.getId());
|
||||
completeTaskDTO.setIsStart(true);
|
||||
completeTaskDTO.setIsPass(true);
|
||||
completeTaskDTO.setUserId(task.getAssignee());
|
||||
submitTask(completeTaskDTO);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
package com.snow.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.snow.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.snow.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 离职申请单对象 sys_oa_resign
|
||||
*
|
||||
* @author 没用的阿吉
|
||||
* @date 2021-03-10
|
||||
*/
|
||||
@Data
|
||||
public class SysOaResign extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Integer id;
|
||||
|
||||
/** 离职单号 */
|
||||
@Excel(name = "离职单号")
|
||||
private String resignNo;
|
||||
|
||||
/** 离职标题 */
|
||||
@Excel(name = "离职标题")
|
||||
private String name;
|
||||
|
||||
/** 离职理由 */
|
||||
@Excel(name = "离职理由")
|
||||
private String reason;
|
||||
|
||||
/** 离职去向 */
|
||||
@Excel(name = "离职去向")
|
||||
private String resignPlaceGo;
|
||||
|
||||
/** 交接人 */
|
||||
@Excel(name = "交接人")
|
||||
private String transitionPerson;
|
||||
|
||||
/** 离职时间 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "离职时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date resignTime;
|
||||
|
||||
/** 离职类型(0--自动离职,1-劳动合同期满,2--被辞退,3--其他) */
|
||||
@Excel(name = "离职类型", readConverterExp = "0=--自动离职,1-劳动合同期满,2--被辞退,3--其他")
|
||||
private Integer resignType;
|
||||
|
||||
/** 流程状态(0--待发起,1-审批中,2--审批通过,3--已驳回,4--作废) */
|
||||
@Excel(name = "流程状态", readConverterExp = "0=--待发起,1-审批中,2--审批通过,3--已驳回,4--作废")
|
||||
private Integer processStatus;
|
||||
|
||||
/** 离职申请人 */
|
||||
private String applyPerson;
|
||||
|
||||
/** 删除标识(0--正常,1--删除) */
|
||||
private Integer isDelete;
|
||||
|
||||
/** 附件 */
|
||||
@Excel(name = "附件")
|
||||
private String fileUrl;
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package com.snow.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.snow.system.domain.SysOaResign;
|
||||
|
||||
/**
|
||||
* 离职申请单Mapper接口
|
||||
*
|
||||
* @author 没用的阿吉
|
||||
* @date 2021-03-10
|
||||
*/
|
||||
public interface SysOaResignMapper
|
||||
{
|
||||
/**
|
||||
* 查询离职申请单
|
||||
*
|
||||
* @param id 离职申请单ID
|
||||
* @return 离职申请单
|
||||
*/
|
||||
public SysOaResign selectSysOaResignById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询离职申请单列表
|
||||
*
|
||||
* @param sysOaResign 离职申请单
|
||||
* @return 离职申请单集合
|
||||
*/
|
||||
public List<SysOaResign> selectSysOaResignList(SysOaResign sysOaResign);
|
||||
|
||||
/**
|
||||
* 新增离职申请单
|
||||
*
|
||||
* @param sysOaResign 离职申请单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysOaResign(SysOaResign sysOaResign);
|
||||
|
||||
/**
|
||||
* 修改离职申请单
|
||||
*
|
||||
* @param sysOaResign 离职申请单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysOaResign(SysOaResign sysOaResign);
|
||||
|
||||
|
||||
/**
|
||||
*修改离职申请单根据单号
|
||||
* @param sysOaResign
|
||||
* @return
|
||||
*/
|
||||
public int updateSysOaResignByResignNo(SysOaResign sysOaResign);
|
||||
|
||||
/**
|
||||
* 删除离职申请单
|
||||
*
|
||||
* @param id 离职申请单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysOaResignById(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除离职申请单
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysOaResignByIds(String[] ids);
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.snow.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.snow.system.domain.SysOaResign;
|
||||
|
||||
/**
|
||||
* 离职申请单Service接口
|
||||
*
|
||||
* @author 没用的阿吉
|
||||
* @date 2021-03-10
|
||||
*/
|
||||
public interface ISysOaResignService
|
||||
{
|
||||
/**
|
||||
* 查询离职申请单
|
||||
*
|
||||
* @param id 离职申请单ID
|
||||
* @return 离职申请单
|
||||
*/
|
||||
public SysOaResign selectSysOaResignById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询离职申请单列表
|
||||
*
|
||||
* @param sysOaResign 离职申请单
|
||||
* @return 离职申请单集合
|
||||
*/
|
||||
public List<SysOaResign> selectSysOaResignList(SysOaResign sysOaResign);
|
||||
|
||||
/**
|
||||
* 新增离职申请单
|
||||
*
|
||||
* @param sysOaResign 离职申请单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysOaResign(SysOaResign sysOaResign);
|
||||
|
||||
/**
|
||||
* 修改离职申请单
|
||||
*
|
||||
* @param sysOaResign 离职申请单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysOaResign(SysOaResign sysOaResign);
|
||||
|
||||
/**
|
||||
* 根据离职单号修改申请单
|
||||
* @param sysOaResign
|
||||
* @return
|
||||
*/
|
||||
public int updateSysOaResignByResignNo(SysOaResign sysOaResign);
|
||||
|
||||
/**
|
||||
* 批量删除离职申请单
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysOaResignByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除离职申请单信息
|
||||
*
|
||||
* @param id 离职申请单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysOaResignById(Integer id);
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
package com.snow.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.snow.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.snow.system.mapper.SysOaResignMapper;
|
||||
import com.snow.system.domain.SysOaResign;
|
||||
import com.snow.system.service.ISysOaResignService;
|
||||
import com.snow.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 离职申请单Service业务层处理
|
||||
*
|
||||
* @author 没用的阿吉
|
||||
* @date 2021-03-10
|
||||
*/
|
||||
@Service
|
||||
public class SysOaResignServiceImpl implements ISysOaResignService
|
||||
{
|
||||
@Autowired
|
||||
private SysOaResignMapper sysOaResignMapper;
|
||||
|
||||
/**
|
||||
* 查询离职申请单
|
||||
*
|
||||
* @param id 离职申请单ID
|
||||
* @return 离职申请单
|
||||
*/
|
||||
@Override
|
||||
public SysOaResign selectSysOaResignById(Integer id)
|
||||
{
|
||||
return sysOaResignMapper.selectSysOaResignById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询离职申请单列表
|
||||
*
|
||||
* @param sysOaResign 离职申请单
|
||||
* @return 离职申请单
|
||||
*/
|
||||
@Override
|
||||
public List<SysOaResign> selectSysOaResignList(SysOaResign sysOaResign)
|
||||
{
|
||||
return sysOaResignMapper.selectSysOaResignList(sysOaResign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增离职申请单
|
||||
*
|
||||
* @param sysOaResign 离职申请单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysOaResign(SysOaResign sysOaResign)
|
||||
{
|
||||
sysOaResign.setCreateTime(DateUtils.getNowDate());
|
||||
return sysOaResignMapper.insertSysOaResign(sysOaResign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改离职申请单
|
||||
*
|
||||
* @param sysOaResign 离职申请单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysOaResign(SysOaResign sysOaResign)
|
||||
{
|
||||
sysOaResign.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysOaResignMapper.updateSysOaResign(sysOaResign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据离职单号修改申请单
|
||||
* @param sysOaResign
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateSysOaResignByResignNo(SysOaResign sysOaResign) {
|
||||
sysOaResign.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysOaResignMapper.updateSysOaResignByResignNo(sysOaResign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除离职申请单对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysOaResignByIds(String ids)
|
||||
{
|
||||
return sysOaResignMapper.deleteSysOaResignByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除离职申请单信息
|
||||
*
|
||||
* @param id 离职申请单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysOaResignById(Integer id)
|
||||
{
|
||||
return sysOaResignMapper.deleteSysOaResignById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,149 @@
|
|||
<?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="com.snow.system.mapper.SysOaResignMapper">
|
||||
|
||||
<resultMap type="SysOaResign" id="SysOaResignResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="resignNo" column="resign_no" />
|
||||
<result property="name" column="name" />
|
||||
<result property="reason" column="reason" />
|
||||
<result property="resignPlaceGo" column="resign_place_go" />
|
||||
<result property="transitionPerson" column="transition_person" />
|
||||
<result property="resignTime" column="resign_time" />
|
||||
<result property="resignType" column="resign_type" />
|
||||
<result property="processStatus" column="process_status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="applyPerson" column="apply_person" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="fileUrl" column="file_url" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysOaResignVo">
|
||||
select id, resign_no, name, reason, resign_place_go, transition_person, resign_time, resign_type, process_status, create_by, create_time, update_time, update_by, apply_person, remark, is_delete, file_url from sys_oa_resign
|
||||
</sql>
|
||||
|
||||
<select id="selectSysOaResignList" parameterType="SysOaResign" resultMap="SysOaResignResult">
|
||||
<include refid="selectSysOaResignVo"/>
|
||||
<where>
|
||||
<if test="resignNo != null and resignNo != ''"> and resign_no = #{resignNo}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
||||
<if test="resignPlaceGo != null and resignPlaceGo != ''"> and resign_place_go = #{resignPlaceGo}</if>
|
||||
<if test="transitionPerson != null and transitionPerson != ''"> and transition_person = #{transitionPerson}</if>
|
||||
<if test="resignTime != null "> and resign_time = #{resignTime}</if>
|
||||
<if test="resignType != null "> and resign_type = #{resignType}</if>
|
||||
<if test="processStatus != null "> and process_status = #{processStatus}</if>
|
||||
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysOaResignById" parameterType="Integer" resultMap="SysOaResignResult">
|
||||
<include refid="selectSysOaResignVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysOaResign" parameterType="SysOaResign" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_oa_resign
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="resignNo != null">resign_no,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="reason != null">reason,</if>
|
||||
<if test="resignPlaceGo != null">resign_place_go,</if>
|
||||
<if test="transitionPerson != null">transition_person,</if>
|
||||
<if test="resignTime != null">resign_time,</if>
|
||||
<if test="resignType != null">resign_type,</if>
|
||||
<if test="processStatus != null">process_status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="applyPerson != null">apply_person,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="fileUrl != null">file_url,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="resignNo != null">#{resignNo},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="reason != null">#{reason},</if>
|
||||
<if test="resignPlaceGo != null">#{resignPlaceGo},</if>
|
||||
<if test="transitionPerson != null">#{transitionPerson},</if>
|
||||
<if test="resignTime != null">#{resignTime},</if>
|
||||
<if test="resignType != null">#{resignType},</if>
|
||||
<if test="processStatus != null">#{processStatus},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="applyPerson != null">#{applyPerson},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="fileUrl != null">#{fileUrl},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysOaResign" parameterType="SysOaResign">
|
||||
update sys_oa_resign
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="resignNo != null">resign_no = #{resignNo},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="reason != null">reason = #{reason},</if>
|
||||
<if test="resignPlaceGo != null">resign_place_go = #{resignPlaceGo},</if>
|
||||
<if test="transitionPerson != null">transition_person = #{transitionPerson},</if>
|
||||
<if test="resignTime != null">resign_time = #{resignTime},</if>
|
||||
<if test="resignType != null">resign_type = #{resignType},</if>
|
||||
<if test="processStatus != null">process_status = #{processStatus},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="applyPerson != null">apply_person = #{applyPerson},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateSysOaResignByResignNo" parameterType="SysOaResign">
|
||||
update sys_oa_resign
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="resignNo != null">resign_no = #{resignNo},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="reason != null">reason = #{reason},</if>
|
||||
<if test="resignPlaceGo != null">resign_place_go = #{resignPlaceGo},</if>
|
||||
<if test="transitionPerson != null">transition_person = #{transitionPerson},</if>
|
||||
<if test="resignTime != null">resign_time = #{resignTime},</if>
|
||||
<if test="resignType != null">resign_type = #{resignType},</if>
|
||||
<if test="processStatus != null">process_status = #{processStatus},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="applyPerson != null">apply_person = #{applyPerson},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
</trim>
|
||||
where resign_no = #{resignNo}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysOaResignById" parameterType="Integer">
|
||||
delete from sys_oa_resign where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysOaResignByIds" parameterType="String">
|
||||
delete from sys_oa_resign where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue