请假补假

This commit is contained in:
2026-04-09 13:12:26 +08:00
parent ebf57c2e82
commit 0377a0cc8c
6 changed files with 36 additions and 44 deletions

11
pom.xml
View File

@ -603,6 +603,17 @@
<groupId>org.redisson</groupId> <groupId>org.redisson</groupId>
<artifactId>redisson</artifactId> <artifactId>redisson</artifactId>
<version>3.11.4</version> <version>3.11.4</version>
<exclusions>
<!-- 项目仍使用 jodd 3.x排除 redisson 传入的 jodd 5.x避免运行时方法签名冲突 -->
<exclusion>
<groupId>org.jodd</groupId>
<artifactId>jodd-bean</artifactId>
</exclusion>
<exclusion>
<groupId>org.jodd</groupId>
<artifactId>jodd-core</artifactId>
</exclusion>
</exclusions>
<!-- <version>3.13.3</version>--> <!-- <version>3.13.3</version>-->
</dependency> </dependency>
<!-- zkclient --> <!-- zkclient -->

View File

@ -49,14 +49,14 @@
insert into tb_administration_leave_apply ( insert into tb_administration_leave_apply (
id, insdt, insuser, upduser, upddt, unit_id, apply_type, leave_type, start_time, end_time, id, insdt, insuser, upduser, upddt, unit_id, apply_type, leave_type, start_time, end_time,
hours, days, reason, handover_desc, attachment_ids, overtime_ref_id, overtime_hours, hours, days, reason, handover_desc, attachment_ids, overtime_ref_id, overtime_hours,
actual_start_time, actual_end_time, state, audit_man_id, submission_time, processid, actual_start_time, actual_end_time, state, submission_time, processid,
processdefid, remark, del_flag) processdefid, remark, del_flag)
values ( values (
#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{upduser,jdbcType=VARCHAR}, #{upddt,jdbcType=TIMESTAMP}, #{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{upduser,jdbcType=VARCHAR}, #{upddt,jdbcType=TIMESTAMP},
#{unitId,jdbcType=VARCHAR}, #{applyType,jdbcType=VARCHAR}, #{leaveType,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{unitId,jdbcType=VARCHAR}, #{applyType,jdbcType=VARCHAR}, #{leaveType,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
NULLIF(#{hours,jdbcType=VARCHAR}, ''), NULLIF(#{days,jdbcType=VARCHAR}, ''), #{reason,jdbcType=VARCHAR}, #{handoverDesc,jdbcType=VARCHAR}, #{attachmentIds,jdbcType=VARCHAR}, NULLIF(#{hours,jdbcType=VARCHAR}, ''), NULLIF(#{days,jdbcType=VARCHAR}, ''), #{reason,jdbcType=VARCHAR}, #{handoverDesc,jdbcType=VARCHAR}, #{attachmentIds,jdbcType=VARCHAR},
#{overtimeRefId,jdbcType=VARCHAR}, NULLIF(#{overtimeHours,jdbcType=VARCHAR}, ''), #{actualStartTime,jdbcType=TIMESTAMP}, #{actualEndTime,jdbcType=TIMESTAMP}, #{overtimeRefId,jdbcType=VARCHAR}, NULLIF(#{overtimeHours,jdbcType=VARCHAR}, ''), #{actualStartTime,jdbcType=TIMESTAMP}, #{actualEndTime,jdbcType=TIMESTAMP},
#{state,jdbcType=VARCHAR}, #{auditManId,jdbcType=VARCHAR}, #{submissionTime,jdbcType=TIMESTAMP}, #{processid,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, #{submissionTime,jdbcType=TIMESTAMP}, #{processid,jdbcType=VARCHAR},
#{processdefid,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR}) #{processdefid,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.sipai.entity.administration.LeaveApply" > <insert id="insertSelective" parameterType="com.sipai.entity.administration.LeaveApply" >
@ -82,7 +82,6 @@
<if test="actualStartTime != null" >actual_start_time,</if> <if test="actualStartTime != null" >actual_start_time,</if>
<if test="actualEndTime != null" >actual_end_time,</if> <if test="actualEndTime != null" >actual_end_time,</if>
<if test="state != null" >state,</if> <if test="state != null" >state,</if>
<if test="auditManId != null" >audit_man_id,</if>
<if test="submissionTime != null" >submission_time,</if> <if test="submissionTime != null" >submission_time,</if>
<if test="processid != null" >processid,</if> <if test="processid != null" >processid,</if>
<if test="processdefid != null" >processdefid,</if> <if test="processdefid != null" >processdefid,</if>
@ -110,7 +109,6 @@
<if test="actualStartTime != null" >#{actualStartTime,jdbcType=TIMESTAMP},</if> <if test="actualStartTime != null" >#{actualStartTime,jdbcType=TIMESTAMP},</if>
<if test="actualEndTime != null" >#{actualEndTime,jdbcType=TIMESTAMP},</if> <if test="actualEndTime != null" >#{actualEndTime,jdbcType=TIMESTAMP},</if>
<if test="state != null" >#{state,jdbcType=VARCHAR},</if> <if test="state != null" >#{state,jdbcType=VARCHAR},</if>
<if test="auditManId != null" >#{auditManId,jdbcType=VARCHAR},</if>
<if test="submissionTime != null" >#{submissionTime,jdbcType=TIMESTAMP},</if> <if test="submissionTime != null" >#{submissionTime,jdbcType=TIMESTAMP},</if>
<if test="processid != null" >#{processid,jdbcType=VARCHAR},</if> <if test="processid != null" >#{processid,jdbcType=VARCHAR},</if>
<if test="processdefid != null" >#{processdefid,jdbcType=VARCHAR},</if> <if test="processdefid != null" >#{processdefid,jdbcType=VARCHAR},</if>
@ -140,7 +138,7 @@
<if test="actualStartTime != null" >actual_start_time = #{actualStartTime,jdbcType=TIMESTAMP},</if> <if test="actualStartTime != null" >actual_start_time = #{actualStartTime,jdbcType=TIMESTAMP},</if>
<if test="actualEndTime != null" >actual_end_time = #{actualEndTime,jdbcType=TIMESTAMP},</if> <if test="actualEndTime != null" >actual_end_time = #{actualEndTime,jdbcType=TIMESTAMP},</if>
<if test="state != null" >state = #{state,jdbcType=VARCHAR},</if> <if test="state != null" >state = #{state,jdbcType=VARCHAR},</if>
<if test="auditManId != null" >audit_man_id = #{auditManId,jdbcType=VARCHAR},</if> audit_man_id = NULL,
<if test="submissionTime != null" >submission_time = #{submissionTime,jdbcType=TIMESTAMP},</if> <if test="submissionTime != null" >submission_time = #{submissionTime,jdbcType=TIMESTAMP},</if>
<if test="processid != null" >processid = #{processid,jdbcType=VARCHAR},</if> <if test="processid != null" >processid = #{processid,jdbcType=VARCHAR},</if>
<if test="processdefid != null" >processdefid = #{processdefid,jdbcType=VARCHAR},</if> <if test="processdefid != null" >processdefid = #{processdefid,jdbcType=VARCHAR},</if>

View File

@ -127,7 +127,6 @@ public class LeaveApplyService implements CommService<LeaveApply> {
if (StringUtils.isBlank(candidateUserIds)) { if (StringUtils.isBlank(candidateUserIds)) {
return MaintenanceCommString.Response_StartProcess_NoUser; return MaintenanceCommString.Response_StartProcess_NoUser;
} }
leaveApply.setAuditManId(candidateUserIds);
variables.put("userIds", candidateUserIds); variables.put("userIds", candidateUserIds);
variables.put("applyType", leaveApply.getApplyType()); variables.put("applyType", leaveApply.getApplyType());
variables.put("leaveType", leaveApply.getLeaveType()); variables.put("leaveType", leaveApply.getLeaveType());
@ -252,11 +251,6 @@ public class LeaveApplyService implements CommService<LeaveApply> {
if (resourceId == null) { if (resourceId == null) {
resourceId = BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT; resourceId = BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT;
} }
String auditManId = StringUtils.trimToNull(leaveApply.getAuditManId());
if (auditManId != null && (StringUtils.isBlank(leaveApply.getProcessid())
|| BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT.equals(resourceId))) {
return auditManId;
}
String jobIds = StringUtils.trimToNull(this.jobService.getJobs4Activiti( String jobIds = StringUtils.trimToNull(this.jobService.getJobs4Activiti(
leaveApply.getUnitId(), ProcessType.Administration_Leave.getId(), resourceId)); leaveApply.getUnitId(), ProcessType.Administration_Leave.getId(), resourceId));
if (StringUtils.isBlank(jobIds) && !BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT.equals(resourceId)) { if (StringUtils.isBlank(jobIds) && !BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT.equals(resourceId)) {
@ -298,11 +292,12 @@ public class LeaveApplyService implements CommService<LeaveApply> {
List<com.sipai.entity.activiti.WorkTask> nextWorkTasks = List<com.sipai.entity.activiti.WorkTask> nextWorkTasks =
workflowProcessDefinitionService.getNextWorkTasks(leaveApply.getProcessdefid(), currentTaskDefinitionKey); workflowProcessDefinitionService.getNextWorkTasks(leaveApply.getProcessdefid(), currentTaskDefinitionKey);
if (nextWorkTasks == null || nextWorkTasks.isEmpty()) { if (nextWorkTasks == null || nextWorkTasks.isEmpty()) {
return this.getDefaultCandidateUserIds(leaveApply); return null;
} }
int expectedRouteNum = routeNum == null ? -1 : routeNum; int expectedRouteNum = routeNum == null ? -1 : routeNum;
boolean matchedRoute = false;
for (com.sipai.entity.activiti.WorkTask workTask : nextWorkTasks) { for (com.sipai.entity.activiti.WorkTask workTask : nextWorkTasks) {
if (workTask == null || !"userTask".equals(workTask.getType())) { if (workTask == null) {
continue; continue;
} }
if (workTask.isPassFlag() != passStatus) { if (workTask.isPassFlag() != passStatus) {
@ -311,9 +306,13 @@ public class LeaveApplyService implements CommService<LeaveApply> {
if (expectedRouteNum >= 0 && workTask.getRouteNum() != expectedRouteNum) { if (expectedRouteNum >= 0 && workTask.getRouteNum() != expectedRouteNum) {
continue; continue;
} }
matchedRoute = true;
if (!"userTask".equals(workTask.getType())) {
continue;
}
return this.getDefaultCandidateUserIds(leaveApply, workTask.getTaskKey()); return this.getDefaultCandidateUserIds(leaveApply, workTask.getTaskKey());
} }
return this.getDefaultCandidateUserIds(leaveApply); return matchedRoute ? null : this.getDefaultCandidateUserIds(leaveApply);
} }
private String joinUserIds(List<String> userIds) { private String joinUserIds(List<String> userIds) {

View File

@ -0,0 +1,14 @@
/*
请假补假流程审批人字段扩容脚本
场景:
1) audit_man_id 保存当前节点候选审批人 ID 列表
2) 组织下候选人员较多时,原 varchar(250/500) 可能被截断
*/
IF OBJECT_ID('dbo.tb_administration_leave_apply', 'U') IS NOT NULL
AND COL_LENGTH('dbo.tb_administration_leave_apply', 'audit_man_id') IS NOT NULL
BEGIN
ALTER TABLE dbo.tb_administration_leave_apply
ALTER COLUMN audit_man_id varchar(max) NULL;
END
GO

View File

@ -62,14 +62,6 @@ function calculateLeaveDays() {
$("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1)); $("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1));
return true; return true;
} }
function showUser4AuditSelectsFun() {
var userIds = $("#auditManId").val();
var companyId = $("#subForm [name='unitId']").val();
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"auditManId",textId:"auditManName",userIds:userIds,companyId:companyId}, function(data) {
$("#user4SelectDiv").html(data);
openModal("user4SelectModal");
});
}
function doSaveLeaveApply(startProcess) { function doSaveLeaveApply(startProcess) {
$("#subForm").bootstrapValidator('validate'); $("#subForm").bootstrapValidator('validate');
if ($("#subForm").data('bootstrapValidator').isValid()) { if ($("#subForm").data('bootstrapValidator').isValid()) {
@ -184,13 +176,6 @@ $(function(){
<label class="col-sm-3 control-label">天数</label> <label class="col-sm-3 control-label">天数</label>
<div class="col-sm-8"><input type="text" class="form-control" id="days" name="days" readonly placeholder="自动计算"></div> <div class="col-sm-8"><input type="text" class="form-control" id="days" name="days" readonly placeholder="自动计算"></div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">审批人</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="auditManName" name="auditManName" onclick="showUser4AuditSelectsFun();" placeholder="可不选;不选时谁签收谁审批">
<input type="hidden" id="auditManId" name="auditManId">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">申请事由</label> <label class="col-sm-3 control-label">申请事由</label>
<div class="col-sm-8"><textarea class="form-control" rows="3" name="reason"></textarea></div> <div class="col-sm-8"><textarea class="form-control" rows="3" name="reason"></textarea></div>

View File

@ -67,14 +67,6 @@ function calculateLeaveDays() {
$("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1)); $("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1));
return true; return true;
} }
function showUser4AuditSelectsFun() {
var userIds = $("#auditManId").val();
var companyId = $("#subForm [name='unitId']").val();
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"auditManId",textId:"auditManName",userIds:userIds,companyId:companyId}, function(data) {
$("#user4SelectDiv").html(data);
openModal("user4SelectModal");
});
}
function doUpdateLeaveApply(startProcess) { function doUpdateLeaveApply(startProcess) {
$("#subForm").bootstrapValidator('validate'); $("#subForm").bootstrapValidator('validate');
if ($("#subForm").data('bootstrapValidator').isValid()) { if ($("#subForm").data('bootstrapValidator').isValid()) {
@ -188,13 +180,6 @@ $(function(){
<input type="hidden" id="endTime" name="endTime" value="${leaveApply.endTime}"> <input type="hidden" id="endTime" name="endTime" value="${leaveApply.endTime}">
<input type="hidden" id="hours" name="hours" value="${leaveApply.hours}"> <input type="hidden" id="hours" name="hours" value="${leaveApply.hours}">
<div class="form-group"><label class="col-sm-3 control-label">天数</label><div class="col-sm-8"><input class="form-control" id="days" name="days" value="${leaveApply.days}" readonly placeholder="自动计算"></div></div> <div class="form-group"><label class="col-sm-3 control-label">天数</label><div class="col-sm-8"><input class="form-control" id="days" name="days" value="${leaveApply.days}" readonly placeholder="自动计算"></div></div>
<div class="form-group">
<label class="col-sm-3 control-label">审批人</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="auditManName" name="auditManName" value="${leaveApply.auditMan}" onclick="showUser4AuditSelectsFun();" placeholder="可不选;不选时谁签收谁审批">
<input type="hidden" id="auditManId" name="auditManId" value="${leaveApply.auditManId}">
</div>
</div>
<div class="form-group"><label class="col-sm-3 control-label">申请事由</label><div class="col-sm-8"><textarea class="form-control" rows="3" name="reason">${leaveApply.reason}</textarea></div></div> <div class="form-group"><label class="col-sm-3 control-label">申请事由</label><div class="col-sm-8"><textarea class="form-control" rows="3" name="reason">${leaveApply.reason}</textarea></div></div>
<div class="form-group"><label class="col-sm-3 control-label">工作交接</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="handoverDesc">${leaveApply.handoverDesc}</textarea></div></div> <div class="form-group"><label class="col-sm-3 control-label">工作交接</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="handoverDesc">${leaveApply.handoverDesc}</textarea></div></div>
<div class="form-group"><label class="col-sm-3 control-label">备注</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="remark">${leaveApply.remark}</textarea></div></div> <div class="form-group"><label class="col-sm-3 control-label">备注</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="remark">${leaveApply.remark}</textarea></div></div>