parent
c8fed6540d
commit
8f4251d31d
|
|
@ -13,7 +13,9 @@ import com.bonus.system.api.domain.SysUser;
|
||||||
import com.bonus.system.dept.dao.ProDeptRoleDao;
|
import com.bonus.system.dept.dao.ProDeptRoleDao;
|
||||||
import com.bonus.system.evection.entity.EvectionBean;
|
import com.bonus.system.evection.entity.EvectionBean;
|
||||||
import com.bonus.system.evection.service.EvectionService;
|
import com.bonus.system.evection.service.EvectionService;
|
||||||
|
import com.bonus.system.holiday.dao.HolidayDao;
|
||||||
import com.bonus.system.holiday.dao.WorkReportDao;
|
import com.bonus.system.holiday.dao.WorkReportDao;
|
||||||
|
import com.bonus.system.holiday.entity.HolidayBean;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -39,6 +41,9 @@ public class EvectionController extends BaseController {
|
||||||
@Resource(name = "ProDeptRoleDao")
|
@Resource(name = "ProDeptRoleDao")
|
||||||
private ProDeptRoleDao proDeptRoleDao;
|
private ProDeptRoleDao proDeptRoleDao;
|
||||||
|
|
||||||
|
@Resource(name = "HolidayDao")
|
||||||
|
private HolidayDao holidayDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取出差报备列表(表格)
|
* 获取出差报备列表(表格)
|
||||||
*/
|
*/
|
||||||
|
|
@ -108,6 +113,23 @@ public class EvectionController extends BaseController {
|
||||||
@Log(title = "流程管理->出差报备->新增出差报备", businessType = BusinessType.INSERT)
|
@Log(title = "流程管理->出差报备->新增出差报备", businessType = BusinessType.INSERT)
|
||||||
public AjaxResult add(@Validated @RequestBody EvectionBean o) {
|
public AjaxResult add(@Validated @RequestBody EvectionBean o) {
|
||||||
try{
|
try{
|
||||||
|
|
||||||
|
HolidayBean bean = new HolidayBean();
|
||||||
|
bean.setUserId(o.getUserId());
|
||||||
|
bean.setLeaveStartDate(o.getLeaveStartDate());
|
||||||
|
bean.setLeaveEndDate(o.getLeaveEndDate());
|
||||||
|
// 判断开始时间是否重复
|
||||||
|
List<HolidayBean> list = holidayDao.judgeRepeatStrat(bean);
|
||||||
|
if(list.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的出差开始日期与"+list.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断结束时间是否重复
|
||||||
|
List<HolidayBean> listEnd = holidayDao.judgeRepeatEnd(bean);
|
||||||
|
if(listEnd.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的出差结束日期与"+listEnd.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
int res = evectionService.insertEvection(o);
|
int res = evectionService.insertEvection(o);
|
||||||
return toAjax(res);
|
return toAjax(res);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
@ -128,6 +150,24 @@ public class EvectionController extends BaseController {
|
||||||
if(result!=null){
|
if(result!=null){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HolidayBean bean = new HolidayBean();
|
||||||
|
bean.setId(o.getId());
|
||||||
|
bean.setUserId(o.getUserId());
|
||||||
|
bean.setLeaveStartDate(o.getLeaveStartDate());
|
||||||
|
bean.setLeaveEndDate(o.getLeaveEndDate());
|
||||||
|
// 判断开始时间是否重复
|
||||||
|
List<HolidayBean> list = holidayDao.judgeRepeatStrat(bean);
|
||||||
|
if(list.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的出差开始日期与"+list.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断结束时间是否重复
|
||||||
|
List<HolidayBean> listEnd = holidayDao.judgeRepeatEnd(bean);
|
||||||
|
if(listEnd.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的出差结束日期与"+listEnd.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
int res = evectionService.updateEvection(o);
|
int res = evectionService.updateEvection(o);
|
||||||
return toAjax(res);
|
return toAjax(res);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import com.bonus.system.dept.entity.EightRoleBean;
|
||||||
import com.bonus.system.dept.entity.ProDeptRoleBean;
|
import com.bonus.system.dept.entity.ProDeptRoleBean;
|
||||||
import com.bonus.system.dept.entity.ProDeptRoleDo;
|
import com.bonus.system.dept.entity.ProDeptRoleDo;
|
||||||
import com.bonus.system.dept.entity.SubOrgBean;
|
import com.bonus.system.dept.entity.SubOrgBean;
|
||||||
|
import com.bonus.system.holiday.dao.HolidayDao;
|
||||||
import com.bonus.system.holiday.dao.WorkReportDao;
|
import com.bonus.system.holiday.dao.WorkReportDao;
|
||||||
import com.bonus.system.holiday.entity.HolidayBean;
|
import com.bonus.system.holiday.entity.HolidayBean;
|
||||||
import com.bonus.system.holiday.service.HolidayService;
|
import com.bonus.system.holiday.service.HolidayService;
|
||||||
|
|
@ -52,6 +53,9 @@ public class HolidayController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private SysOrgDao sysOrgDao;
|
private SysOrgDao sysOrgDao;
|
||||||
|
|
||||||
|
@Resource(name = "HolidayDao")
|
||||||
|
private HolidayDao holidayDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取假期列表(表格)
|
* 获取假期列表(表格)
|
||||||
*/
|
*/
|
||||||
|
|
@ -106,6 +110,19 @@ public class HolidayController extends BaseController {
|
||||||
@Log(title = "流程管理->假期管理->新增假期", businessType = BusinessType.INSERT)
|
@Log(title = "流程管理->假期管理->新增假期", businessType = BusinessType.INSERT)
|
||||||
public AjaxResult add(@Validated @RequestBody HolidayBean o) {
|
public AjaxResult add(@Validated @RequestBody HolidayBean o) {
|
||||||
try {
|
try {
|
||||||
|
// 判断开始时间是否重复
|
||||||
|
List<HolidayBean> list = holidayDao.judgeRepeatStrat(o);
|
||||||
|
if(list.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的"+o.getLeaveType()+"开始日期与"+list.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断结束时间是否重复
|
||||||
|
List<HolidayBean> listEnd = holidayDao.judgeRepeatEnd(o);
|
||||||
|
if(listEnd.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的"+o.getLeaveType()+"结束日期与"+listEnd.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
int res = holidayService.insertHoliday(o);
|
int res = holidayService.insertHoliday(o);
|
||||||
return toAjax(res);
|
return toAjax(res);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -137,6 +154,18 @@ public class HolidayController extends BaseController {
|
||||||
@Log(title = "流程管理->假期管理->修改请假单", businessType = BusinessType.UPDATE)
|
@Log(title = "流程管理->假期管理->修改请假单", businessType = BusinessType.UPDATE)
|
||||||
public AjaxResult edit(@Validated @RequestBody HolidayBean o) {
|
public AjaxResult edit(@Validated @RequestBody HolidayBean o) {
|
||||||
try {
|
try {
|
||||||
|
// 判断开始时间是否重复
|
||||||
|
List<HolidayBean> list = holidayDao.judgeRepeatStrat(o);
|
||||||
|
if(list.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的"+o.getLeaveType()+"开始日期与"+list.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断结束时间是否重复
|
||||||
|
List<HolidayBean> listEnd = holidayDao.judgeRepeatEnd(o);
|
||||||
|
if(listEnd.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的"+o.getLeaveType()+"结束日期与"+list.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
int res = holidayService.updateHoliday(o);
|
int res = holidayService.updateHoliday(o);
|
||||||
return toAjax(res);
|
return toAjax(res);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -97,4 +97,18 @@ public interface HolidayDao {
|
||||||
* @date 2025/2/11 14:34
|
* @date 2025/2/11 14:34
|
||||||
*/
|
*/
|
||||||
void batchCheckStatus(HolidayBean o);
|
void batchCheckStatus(HolidayBean o);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否重复开始
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<HolidayBean> judgeRepeatStrat(HolidayBean o);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否重复结束
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<HolidayBean> judgeRepeatEnd(HolidayBean o);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.bonus.system.api.domain.MapVo;
|
||||||
import com.bonus.system.api.domain.SysRole;
|
import com.bonus.system.api.domain.SysRole;
|
||||||
import com.bonus.system.api.domain.SysUser;
|
import com.bonus.system.api.domain.SysUser;
|
||||||
import com.bonus.system.dept.dao.ProDeptRoleDao;
|
import com.bonus.system.dept.dao.ProDeptRoleDao;
|
||||||
|
import com.bonus.system.holiday.dao.HolidayDao;
|
||||||
import com.bonus.system.holiday.dao.WorkReportDao;
|
import com.bonus.system.holiday.dao.WorkReportDao;
|
||||||
import com.bonus.system.holiday.entity.HolidayBean;
|
import com.bonus.system.holiday.entity.HolidayBean;
|
||||||
import com.bonus.system.leaveReporting.entity.LeaveReportingBean;
|
import com.bonus.system.leaveReporting.entity.LeaveReportingBean;
|
||||||
|
|
@ -40,6 +41,9 @@ public class LeaveReportingController extends BaseController {
|
||||||
@Resource(name = "ProDeptRoleDao")
|
@Resource(name = "ProDeptRoleDao")
|
||||||
private ProDeptRoleDao proDeptRoleDao;
|
private ProDeptRoleDao proDeptRoleDao;
|
||||||
|
|
||||||
|
@Resource(name = "HolidayDao")
|
||||||
|
private HolidayDao holidayDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取休假报备列表(表格)
|
* 获取休假报备列表(表格)
|
||||||
*/
|
*/
|
||||||
|
|
@ -89,6 +93,22 @@ public class LeaveReportingController extends BaseController {
|
||||||
@Log(title = "流程管理->休假报备->新增休假报备", businessType = BusinessType.INSERT)
|
@Log(title = "流程管理->休假报备->新增休假报备", businessType = BusinessType.INSERT)
|
||||||
public AjaxResult add(@Validated @RequestBody LeaveReportingBean o) {
|
public AjaxResult add(@Validated @RequestBody LeaveReportingBean o) {
|
||||||
try{
|
try{
|
||||||
|
HolidayBean bean = new HolidayBean();
|
||||||
|
bean.setUserId(o.getUserId());
|
||||||
|
bean.setLeaveStartDate(o.getLeaveStartDate());
|
||||||
|
bean.setLeaveEndDate(o.getLeaveEndDate());
|
||||||
|
// 判断开始时间是否重复
|
||||||
|
List<HolidayBean> list = holidayDao.judgeRepeatStrat(bean);
|
||||||
|
if(list.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的休假开始日期与"+list.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断结束时间是否重复
|
||||||
|
List<HolidayBean> listEnd = holidayDao.judgeRepeatEnd(bean);
|
||||||
|
if(listEnd.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的休假结束日期与"+listEnd.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
int res = leaveReportingService.insertLeaveReporting(o);
|
int res = leaveReportingService.insertLeaveReporting(o);
|
||||||
return toAjax(res);
|
return toAjax(res);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
@ -109,6 +129,24 @@ public class LeaveReportingController extends BaseController {
|
||||||
if(result!=null){
|
if(result!=null){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HolidayBean bean = new HolidayBean();
|
||||||
|
bean.setId(o.getId());
|
||||||
|
bean.setUserId(o.getUserId());
|
||||||
|
bean.setLeaveStartDate(o.getLeaveStartDate());
|
||||||
|
bean.setLeaveEndDate(o.getLeaveEndDate());
|
||||||
|
// 判断开始时间是否重复
|
||||||
|
List<HolidayBean> list = holidayDao.judgeRepeatStrat(bean);
|
||||||
|
if(list.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的休假开始日期与"+list.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断结束时间是否重复
|
||||||
|
List<HolidayBean> listEnd = holidayDao.judgeRepeatEnd(bean);
|
||||||
|
if(listEnd.size()>0){
|
||||||
|
return AjaxResult.error("当前提交的休假结束日期与"+listEnd.get(0).getType()+"存在冲突日期"+list.get(0).getLeaveStartDate()+"~"+list.get(0).getLeaveEndDate());
|
||||||
|
}
|
||||||
|
|
||||||
int res = leaveReportingService.updateLeaveReporting(o);
|
int res = leaveReportingService.updateLeaveReporting(o);
|
||||||
return toAjax(res);
|
return toAjax(res);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
|
||||||
|
|
@ -236,4 +236,36 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="judgeRepeatStrat" resultType="com.bonus.system.holiday.entity.HolidayBean">
|
||||||
|
SELECT leave_type AS leaveType,
|
||||||
|
`type`,
|
||||||
|
leave_start_date,
|
||||||
|
leave_end_date,
|
||||||
|
leave_start_interval AS leaveStartInterval,
|
||||||
|
leave_end_interval AS leaveEndInterval,
|
||||||
|
user_name AS userName
|
||||||
|
FROM leave_apply
|
||||||
|
WHERE is_active = '1' and user_id = #{userId} and #{leaveStartDate} BETWEEN leave_start_date AND leave_end_date
|
||||||
|
<if test='id != null and id !=""'>
|
||||||
|
and id !=#{id}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="judgeRepeatEnd" resultType="com.bonus.system.holiday.entity.HolidayBean">
|
||||||
|
SELECT leave_type AS leaveType,
|
||||||
|
`type`,
|
||||||
|
leave_start_date,
|
||||||
|
leave_end_date,
|
||||||
|
leave_start_interval AS leaveStartInterval,
|
||||||
|
leave_end_interval AS leaveEndInterval,
|
||||||
|
user_name AS userName
|
||||||
|
FROM leave_apply
|
||||||
|
WHERE is_active = '1' and user_id = #{userId} and #{leaveEndDate} BETWEEN leave_start_date AND leave_end_date
|
||||||
|
<if test='id != null and id !=""'>
|
||||||
|
and id !=#{id}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue