假期修改

This commit is contained in:
cwchen 2025-02-20 19:41:46 +08:00
parent 86ab2a5f2e
commit 779f9adc16
2 changed files with 19 additions and 6 deletions

View File

@ -22,6 +22,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
/**
@ -259,6 +261,12 @@ public class WeChatController {
try{
EvectionBean bean = new EvectionBean();
BeanUtils.copyProperties(data.getData(),bean);
LocalDateTime localDateTime = data.getData().getLeaveStartDate().atStartOfDay();
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
LocalDateTime localDateTime2 = data.getData().getLeaveEndDate().atStartOfDay();
Date date2 = Date.from(localDateTime2.atZone(ZoneId.systemDefault()).toInstant());
bean.setLeaveStartDate(date);
bean.setLeaveEndDate(date2);
String result = verifyDateService.verifyDate(bean,2);
if(StringUtils.isNotEmpty(result)){
return ServerResponse.createErroe(result);
@ -281,6 +289,12 @@ public class WeChatController {
try {
EvectionBean bean = new EvectionBean();
BeanUtils.copyProperties(data.getData(),bean);
LocalDateTime localDateTime = data.getData().getLeaveStartDate().atStartOfDay();
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
LocalDateTime localDateTime2 = data.getData().getLeaveEndDate().atStartOfDay();
Date date2 = Date.from(localDateTime2.atZone(ZoneId.systemDefault()).toInstant());
bean.setLeaveStartDate(date);
bean.setLeaveEndDate(date2);
// 判断数据是否处于同步状态若处于同步状态则禁止操作
Integer syncStatus = service.dataIsSync(bean,2);
if(Objects.equals(syncStatus,1)){

View File

@ -27,14 +27,14 @@
leave_end_date,
leave_end_interval,
leave_duration, source, create_user_id, is_agree, location, host_user_id,
host_user_name, remark, examine_status)
host_user_name, remark, examine_status,is_update,is_sync)
VALUES (#{uuid}, #{userId}, #{userName}, #{orgId}, #{orgName}, #{leaveType}, '请假', #{leaveReason},
#{leaveStartDate},
#{leaveStartInterval},
#{leaveEndDate},
#{leaveEndInterval},
#{leaveDuration}, #{source}, #{createUserId}, #{isAgree}, #{location}, #{hostUserId}, #{hostUserName},
#{remark}, '1')
#{remark}, '1','0','0')
</insert>
<insert id="insertHoliday">
@ -81,7 +81,6 @@
leave_end_date = #{leaveEndDate},
leave_end_interval = #{leaveEndInterval},
leave_duration = #{leaveDuration},
examine_status = #{examineStatus},
update_user_id = #{updateUserId},
is_agree = #{isAgree},
location = #{location},
@ -480,10 +479,10 @@
FROM leave_apply_wechat
<where>
<if test="type == 1">
AND leave_form_id = #{uuid}
AND leave_form_id = #{params.uuid}
</if>
<if test="type == 2">
AND `uuid` = #{uuid}
AND `uuid` = #{params.uuid}
</if>
</where>
LIMIT 1
@ -493,7 +492,7 @@
SELECT la.uuid,
la.leave_start_date AS leaveStartDate,
la.leave_end_date AS leaveEndDate,
la.org_id AS orgId,
la.org_id AS orgId
FROM leave_apply_wechat la
<where>
<if test="type == 1">