|  | @@ -8,6 +8,7 @@ import cn.hutool.core.date.DateField;
 | 
	
		
			
				|  |  |  import cn.hutool.core.date.DateTime;
 | 
	
		
			
				|  |  |  import cn.hutool.core.date.DateUtil;
 | 
	
		
			
				|  |  |  import cn.hutool.core.util.ObjectUtil;
 | 
	
		
			
				|  |  | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.utils.DateUtils;
 | 
	
	
		
			
				|  | @@ -446,6 +447,10 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              return workTime;
 | 
	
		
			
				|  |  |          }, true);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        workTimeService.remove(new LambdaQueryWrapper<SysWorkTime>().eq(SysWorkTime::getOrgId,orgId).ge(SysWorkTime::getYmdDate,workTimeList.get(0).getDate()).eq(SysWorkTime::getIsManual,0));
 | 
	
		
			
				|  |  | +        List<SysWorkTime> exit = workTimeService.getBaseMapper().selectList(new LambdaQueryWrapper<SysWorkTime>().eq(SysWorkTime::getOrgId, orgId).ge(SysWorkTime::getYmdDate, workTimeList.get(0).getDate()).eq(SysWorkTime::getIsManual, 1));
 | 
	
		
			
				|  |  |          //去掉workTimeList中orgId和ymd相同的数据
 | 
	
		
			
				|  |  |          List<SysWorkTime> list1 = workTimeList.stream().filter(s -> {
 | 
	
		
			
				|  |  |              return list.stream().noneMatch(f -> f.getOrgId().equals(s.getOrgId()) && f.getYmdDate().equals(s.getYmd().getDate()));
 | 
	
	
		
			
				|  | @@ -457,6 +462,7 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
 | 
	
		
			
				|  |  |  //        }
 | 
	
		
			
				|  |  |          for (SysWorkTime s :
 | 
	
		
			
				|  |  |                  list1) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              s.setYmdDate(s.getDate());
 | 
	
		
			
				|  |  |              s.setYmdDay(Long.valueOf(s.getYmd().getDay()));
 | 
	
		
			
				|  |  |              s.setYmdHalfyear(Long.valueOf(s.getYmd().getHalfyear()));
 | 
	
	
		
			
				|  | @@ -466,6 +472,14 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
 | 
	
		
			
				|  |  |              s.setYmdQuarter(Long.valueOf(s.getYmd().getQuarter()));
 | 
	
		
			
				|  |  |              s.setYmdWeek(Long.valueOf(s.getYmd().getWeek()));
 | 
	
		
			
				|  |  |              s.setYmdYear(Long.valueOf(s.getYmd().getYear()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //如果已存在手动添加的作息则跳过
 | 
	
		
			
				|  |  | +            for (SysWorkTime s2 :
 | 
	
		
			
				|  |  | +                    exit) {
 | 
	
		
			
				|  |  | +                if (s.getYmdDate().compareTo(s2.getYmdDate()) == 0) {
 | 
	
		
			
				|  |  | +                    BeanUtils.copyProperties(s2,s);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          workTimeService.saveOrUpdateBatch(list1);
 | 
	
		
			
				|  |  |  
 |