假期修改
This commit is contained in:
parent
0b4ecffeec
commit
1f0977f71b
|
|
@ -312,6 +312,13 @@ public class WeChatController {
|
|||
if(Objects.equals(syncStatus,1)){
|
||||
return ServerResponse.createErroe("数据同步中,请勿执行删除操作");
|
||||
}
|
||||
if(StringUtils.isNotEmpty(data.getData().getType())){
|
||||
// 判断休假报备数据是否被核对
|
||||
Integer isCheck = service.dataIsCheck(data.getData().getUuid(),2);
|
||||
if(!Objects.equals(isCheck,0)){
|
||||
return ServerResponse.createErroe("休假报备数据已被核对,无法操作");
|
||||
}
|
||||
}
|
||||
return ServerResponse.createSuccess(service.deleteHolidayById(data.getData()));
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
|
|
@ -334,6 +341,12 @@ public class WeChatController {
|
|||
if(Objects.equals(syncStatus,1)){
|
||||
return ServerResponse.createErroe("数据同步中,请勿执行修改操作");
|
||||
}
|
||||
// 判断出差报备数据是否被核对
|
||||
Integer isCheck = service.dataIsCheck(data.getData().getUuid(),1);
|
||||
if(!Objects.equals(isCheck,0)){
|
||||
return ServerResponse.createErroe("休假报备数据已被核对,无法操作");
|
||||
}
|
||||
// 判断休假报备日期是否存在冲突
|
||||
String result = verifyDateService.verifyDate(bean,2);
|
||||
if(StringUtils.isNotEmpty(result)){
|
||||
return ServerResponse.createErroe(result);
|
||||
|
|
@ -357,6 +370,12 @@ public class WeChatController {
|
|||
if(Objects.equals(syncStatus,1)){
|
||||
return ServerResponse.createErroe("数据同步中,请勿执行修改操作");
|
||||
}
|
||||
// 判断出差报备数据是否被核对
|
||||
Integer isCheck = service.dataIsCheck(data.getData().getUuid(),2);
|
||||
if(!Objects.equals(isCheck,0)){
|
||||
return ServerResponse.createErroe("出差报备数据已被核对,无法操作");
|
||||
}
|
||||
// 判断出差报备日期是否存在冲突
|
||||
String[] travelersArr = data.getData().getTravelers().split(",");
|
||||
for (String traveler : travelersArr) {
|
||||
data.getData().setUserId(Long.valueOf(traveler));
|
||||
|
|
@ -384,6 +403,11 @@ public class WeChatController {
|
|||
if(Objects.equals(syncStatus,1)){
|
||||
return ServerResponse.createErroe("数据同步中,请勿执行删除操作");
|
||||
}
|
||||
// 判断出差报备数据是否被核对
|
||||
Integer isCheck = service.dataIsCheck(data.getData().getUuid(),2);
|
||||
if(!Objects.equals(isCheck,0)){
|
||||
return ServerResponse.createErroe("出差报备数据已被核对,无法操作");
|
||||
}
|
||||
return ServerResponse.createSuccess(service.deleteEvectionById(data.getData()));
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.boot.manager.manager.dao;
|
||||
|
||||
import com.bonus.boot.manager.manager.entity.EvectionBean;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -22,5 +23,5 @@ public interface VerifyDateDao {
|
|||
* @author cwchen
|
||||
* @date 2025/2/20 15:44
|
||||
*/
|
||||
List<Map<String, Object>> verifyDate(EvectionBean bean);
|
||||
List<Map<String, Object>> verifyDate(@Param("params") EvectionBean bean,@Param("type") int type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,140 +17,176 @@ import java.util.List;
|
|||
@Mapper
|
||||
public interface WeChatDao {
|
||||
|
||||
UserDto getById(UserDto data);
|
||||
UserDto getByUserId(UserDto data);
|
||||
UserDto getById(UserDto data);
|
||||
|
||||
/**
|
||||
* 查询所有人员-除了当前用户
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> getSelectUserCurrent(String userId);
|
||||
UserDto getByUserId(UserDto data);
|
||||
|
||||
SysUserWechat getSysUserWechat(String userId);
|
||||
/**
|
||||
* 查询所有人员-除了当前用户
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> getSelectUserCurrent(String userId);
|
||||
|
||||
/**
|
||||
* 添加出差报备
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
int insertEvection(EvectionBean o);
|
||||
SysUserWechat getSysUserWechat(String userId);
|
||||
|
||||
List<EvectionBean> selectWchatc(EvectionBean o);
|
||||
/**
|
||||
* 添加出差报备
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
int insertEvection(EvectionBean o);
|
||||
|
||||
List<EvectionBean> selectWchatc(EvectionBean o);
|
||||
|
||||
|
||||
/**
|
||||
* 查询出差报备列表
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<EvectionBean> getEvectionList(EvectionBean bean);
|
||||
|
||||
/**
|
||||
* 查询出差报备列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<EvectionBean> getEvectionList(EvectionBean bean);
|
||||
/**
|
||||
* 根据id查询出差报备详情
|
||||
*
|
||||
* @param uuId
|
||||
* @return
|
||||
*/
|
||||
EvectionBean selectEvectionById(String uuId);
|
||||
|
||||
/**
|
||||
* 根据id查询出差报备详情
|
||||
* @param uuId
|
||||
* @return
|
||||
*/
|
||||
EvectionBean selectEvectionById(String uuId);
|
||||
/**
|
||||
* 添加休假报备
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
int insertLeaveReporting(LeaveReportingBean o);
|
||||
|
||||
/**
|
||||
* 添加休假报备
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
int insertLeaveReporting(LeaveReportingBean o);
|
||||
/**
|
||||
* 轮休、临时外出新增
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
int insertHoliday(HolidayBean o);
|
||||
|
||||
/**
|
||||
* 轮休、临时外出新增
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
int insertHoliday(HolidayBean o);
|
||||
/**
|
||||
* 查询休假报备列表
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<LeaveReportingBean> getLeaveReportingList(LeaveReportingBean bean);
|
||||
|
||||
/**
|
||||
* 查询休假报备列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<LeaveReportingBean> getLeaveReportingList(LeaveReportingBean bean);
|
||||
/**
|
||||
* 根据id查询休假报备详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LeaveReportingBean selectLeaveReportingById(String id);
|
||||
|
||||
/**
|
||||
* 根据id查询休假报备详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LeaveReportingBean selectLeaveReportingById(String id);
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @param newUser
|
||||
* @return
|
||||
*/
|
||||
int updateUser(SysUser newUser);
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
* @param newUser
|
||||
* @return
|
||||
*/
|
||||
int updateUser(SysUser newUser);
|
||||
/**
|
||||
* 查询出差人
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> getTravelPersonSelect();
|
||||
|
||||
/**
|
||||
* 查询出差人
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> getTravelPersonSelect();
|
||||
/**
|
||||
* 查询休假类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<LeaveReportingBean> getHolidayType(LeaveReportingBean data);
|
||||
|
||||
/**
|
||||
* 查询休假类型
|
||||
* @return
|
||||
*/
|
||||
List<LeaveReportingBean> getHolidayType(LeaveReportingBean data);
|
||||
|
||||
/**
|
||||
* 查询节假日
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<LeaveReportingBean> getFestivalAndHoliday(LeaveReportingBean bean);
|
||||
/**
|
||||
* 查询节假日
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<LeaveReportingBean> getFestivalAndHoliday(LeaveReportingBean bean);
|
||||
|
||||
String getAttTypeByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 查询获取轮休列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<HolidayBean> getHolidaysList(HolidayBean bean);
|
||||
/**
|
||||
* 查询获取轮休列表
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<HolidayBean> getHolidaysList(HolidayBean bean);
|
||||
|
||||
/**
|
||||
* 查询获取轮休详情
|
||||
*
|
||||
* @param uuId
|
||||
* @return
|
||||
*/
|
||||
HolidayBean getHolidaysDetail(String uuId);
|
||||
|
||||
/**
|
||||
* 修改轮休
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
int updateHoliday(HolidayBean data);
|
||||
|
||||
/**
|
||||
* 删除轮休
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
int deleteHolidayById(HolidayBean data);
|
||||
|
||||
int editHoliday(LeaveReportingBean data);
|
||||
|
||||
int editEvection(EvectionBean data);
|
||||
|
||||
int deleteEvectionById(EvectionBean data);
|
||||
|
||||
/**
|
||||
* 判断数据是否处于同步状态,若处于同步状态则禁止操作
|
||||
*
|
||||
* @param data
|
||||
* @param type
|
||||
* @return Integer
|
||||
* @author cwchen
|
||||
* @date 2025/2/20 14:09
|
||||
*/
|
||||
Integer dataIsSync(@Param("params") EvectionBean data, @Param("type") int type);
|
||||
|
||||
/**
|
||||
* 查询出差详情
|
||||
* @param uuid
|
||||
* @param type
|
||||
* @return EvectionBean
|
||||
* @author cwchen
|
||||
* @date 2025/2/20 17:08
|
||||
*/
|
||||
EvectionBean getEvectionById(@Param("uuid") String uuid,@Param("type") int type);
|
||||
|
||||
/**
|
||||
* 查询获取轮休详情
|
||||
* @param uuId
|
||||
* @return
|
||||
*/
|
||||
HolidayBean getHolidaysDetail(String uuId);
|
||||
|
||||
/**
|
||||
* 修改轮休
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
int updateHoliday(HolidayBean data);
|
||||
|
||||
/**
|
||||
* 删除轮休
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
int deleteHolidayById(HolidayBean data);
|
||||
|
||||
int editHoliday(LeaveReportingBean data);
|
||||
|
||||
int editEvection(EvectionBean data);
|
||||
|
||||
int deleteEvectionById(EvectionBean data);
|
||||
|
||||
/**
|
||||
* 判断数据是否处于同步状态,若处于同步状态则禁止操作
|
||||
* @param data
|
||||
* @param type
|
||||
* @return Integer
|
||||
* 判断出差报备数据是否被核对
|
||||
* @param evectionBean
|
||||
* @return List<Integer>
|
||||
* @author cwchen
|
||||
* @date 2025/2/20 14:09
|
||||
* @date 2025/2/20 17:09
|
||||
*/
|
||||
Integer dataIsSync(@Param("params") EvectionBean data,@Param("type") int type);
|
||||
List<Integer> isCheck(EvectionBean evectionBean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,4 +158,5 @@ public class HolidayBean {
|
|||
|
||||
/**一键审批ID*/
|
||||
private List<Long> ids;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,4 +130,14 @@ public interface WeChatService {
|
|||
* @date 2025/2/20 14:07
|
||||
*/
|
||||
Integer dataIsSync(EvectionBean data, int type);
|
||||
|
||||
/**
|
||||
* 判断出差/休假数据是否被核对
|
||||
* @param uuid
|
||||
* @param type
|
||||
* @return Integer
|
||||
* @author cwchen
|
||||
* @date 2025/2/20 17:04
|
||||
*/
|
||||
Integer dataIsCheck(String uuid, int type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class VerifyDateService {
|
|||
private VerifyDateDao dao;
|
||||
|
||||
public String verifyDate(EvectionBean bean,int type) {
|
||||
List<Map<String, Object>> list = dao.verifyDate(bean);
|
||||
List<Map<String, Object>> list = dao.verifyDate(bean,type);
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Map<String, Object> dataMap = list.get(0);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.bonus.boot.manager.manager.model.SysUser;
|
|||
import com.bonus.boot.manager.manager.service.WeChatService;
|
||||
import com.bonus.boot.manager.manager.utils.UserUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -322,4 +323,22 @@ public class WeChatServiceImpl implements WeChatService {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer dataIsCheck(String uuid, int type) {
|
||||
try {
|
||||
EvectionBean evectionBean = dao.getEvectionById(uuid,type);
|
||||
List<Integer> list = dao.isCheck(evectionBean);
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for (Integer status : list) {
|
||||
if(!Objects.equals(status,0)){
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,22 @@
|
|||
leave_end_interval AS leaveEndInterval,
|
||||
user_name AS userName
|
||||
FROM leave_apply_wechat
|
||||
WHERE user_id = #{userId} AND is_active = '1'
|
||||
AND (DATE_FORMAT(leave_start_date, '%Y-%m-%d') BETWEEN DATE_FORMAT(#{leaveStartDate}, '%Y-%m-%d') AND DATE_FORMAT(#{leaveEndDate}, '%Y-%m-%d')) OR
|
||||
(DATE_FORMAT(leave_end_date, '%Y-%m-%d') BETWEEN DATE_FORMAT(#{leaveStartDate}, '%Y-%m-%d') AND DATE_FORMAT(#{leaveEndDate}, '%Y-%m-%d'))
|
||||
WHERE user_id = #{params.userId} AND is_active = '1'
|
||||
AND (
|
||||
DATE_FORMAT(leave_start_date, '%Y-%m-%d') BETWEEN DATE_FORMAT(#{params.leaveStartDate}, '%Y-%m-%d') AND
|
||||
DATE_FORMAT(#{params.leaveEndDate}, '%Y-%m-%d') OR
|
||||
DATE_FORMAT(leave_end_date, '%Y-%m-%d') BETWEEN DATE_FORMAT(#{params.leaveStartDate}, '%Y-%m-%d') AND
|
||||
DATE_FORMAT(#{params.leaveEndDate}, '%Y-%m-%d')
|
||||
)
|
||||
<if test="type == 1">
|
||||
<if test="params.uuid!=null and params.uuid!=''">
|
||||
AND leave_form_id != #{params.uuid}
|
||||
</if>
|
||||
</if>
|
||||
<if test="type == 2">
|
||||
<if test="params.uuid!=null and params.uuid!=''">
|
||||
AND uuid != #{params.uuid}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -488,5 +488,29 @@
|
|||
</where>
|
||||
LIMIT 1
|
||||
</select>
|
||||
<!--查询出差详情-->
|
||||
<select id="getEvectionById" resultType="com.bonus.boot.manager.manager.entity.EvectionBean">
|
||||
SELECT la.uuid,
|
||||
la.leave_start_date AS leaveStartDate,
|
||||
la.leave_end_date AS leaveEndDate,
|
||||
la.org_id AS orgId,
|
||||
FROM leave_apply_wechat la
|
||||
<where>
|
||||
<if test="type == 1">
|
||||
AND la.uuid = #{uuid}
|
||||
</if>
|
||||
<if test="type == 2">
|
||||
AND la.leave_form_id = #{uuid} AND submit_id = user_id
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<!--判断出差报备数据是否被核对-->
|
||||
<select id="isCheck" resultType="java.lang.Integer">
|
||||
SELECT status
|
||||
FROM leave_check_wechat lc
|
||||
WHERE lc.org_id = #{orgId} AND (DATE_FORMAT(#{leaveStartDate},'%Y-%m') = lc.month OR DATE_FORMAT(#{leaveEndDate},'%Y-%m') = lc.month)
|
||||
AND lc.is_active = '1'
|
||||
ORDER BY lc.create_time
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue