|
|
@@ -11,6 +11,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
+import com.xunmei.common.core.utils.Ymd;
|
|
|
import com.xunmei.common.core.utils.snowId.DateHelper;
|
|
|
import com.xunmei.common.core.web.domain.AjaxResult;
|
|
|
import com.xunmei.system.api.domain.SysOrg;
|
|
|
@@ -19,6 +20,7 @@ import com.xunmei.system.domain.SysWorkTimeSetDayofweek;
|
|
|
import com.xunmei.system.mapper.SysWorkTimeMapper;
|
|
|
import com.xunmei.system.mapper.SysWorkTimeSetDayofweekMapper;
|
|
|
import com.xunmei.common.core.util.BeanHelper;
|
|
|
+import com.xunmei.system.service.ISysWorkTimeService;
|
|
|
import com.xunmei.system.util.StreamHelper;
|
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
@@ -52,7 +54,8 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
|
|
|
private SysWorkTimeSetDayofweekMapper sysWorkTimeSetDayofweekMapper;
|
|
|
@Autowired
|
|
|
private SysWorkTimeMapper sysWorkTimeMapper;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private ISysWorkTimeService workTimeService;
|
|
|
@Override
|
|
|
public TableDataInfo<SysWorkTimeSet> selectPage(SysWorkTimeSet sysWorkTimeSet) {
|
|
|
//未删除
|
|
|
@@ -426,6 +429,8 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
|
|
|
}
|
|
|
// final SysWorkTime workTime = SysWorkTime.of(orgId, workTimeEditDto.getDate());
|
|
|
final SysWorkTime workTime = new SysWorkTime();
|
|
|
+ workTime.setOrgId(orgId);
|
|
|
+ workTime.setYmd(Ymd.of(workTimeEditDto.getDate()));
|
|
|
BeanHelper.copyProperties(workTime, workTimeEditDto);
|
|
|
workTime.setIsManual(0L);
|
|
|
workTime.setIsEnable(workTimeEditDto.getIsEnable());
|
|
|
@@ -444,11 +449,23 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
|
|
|
List<SysWorkTime> list1 = workTimeList.stream().filter(s -> {
|
|
|
return list.stream().noneMatch(f -> f.getOrgId().equals(s.getOrgId()) && f.getYmdDate().equals(s.getYmd().getDate()));
|
|
|
}).collect(Collectors.toList());
|
|
|
+// for (SysWorkTime s :
|
|
|
+// list1) {
|
|
|
+// sysWorkTimeMapper.insert(s);
|
|
|
+// workTimeList.add(s);
|
|
|
+// }
|
|
|
for (SysWorkTime s :
|
|
|
list1) {
|
|
|
- sysWorkTimeMapper.insert(s);
|
|
|
- workTimeList.add(s);
|
|
|
- }
|
|
|
+ s.setYmdDate(s.getDate());
|
|
|
+ s.setYmdDay(Long.valueOf(s.getYmd().getDay()));
|
|
|
+ s.setYmdHalfyear(Long.valueOf(s.getYmd().getHalfyear()));
|
|
|
+ s.setYmdHour(Long.valueOf(s.getYmd().getHour()));
|
|
|
+ s.setYmdMinute(Long.valueOf(s.getYmd().getMinute()));
|
|
|
+ s.setYmdMonth(Long.valueOf(s.getYmd().getMonth()));
|
|
|
+ s.setYmdQuarter(Long.valueOf(s.getYmd().getQuarter()));
|
|
|
+ s.setYmdWeek(Long.valueOf(s.getYmd().getWeek()));
|
|
|
+ s.setYmdYear(Long.valueOf(s.getYmd().getYear()));
|
|
|
+ } workTimeService.saveBatch(list1);
|
|
|
|
|
|
return workTimeList;
|
|
|
}
|