| | |
| | | if (StringUtils.isBlank(entity.getRepeatEnd())) { |
| | | throw new ApplicationException("周期性结束日期不能为空"); |
| | | } |
| | | if(entity.getFullDayFlag()==1){ |
| | | //表示不需要时间,只有日期 |
| | | entity.setStartTime(entity.getStartTime().trim().split("\\s+")[0]); |
| | | entity.setEndTime(entity.getEndTime().trim().split("\\s+")[0]); |
| | | if(StringUtils.isNotBlank(entity.getRepeatEnd())) { |
| | | entity.setRepeatEnd(entity.getRepeatEnd().trim().split("\\s+")[0]); |
| | | } |
| | | } |
| | | if (entity.getId() == null || entity.getId() == 0) {//新增 |
| | | calRepeatDate(entity, list); |
| | | } else if (entity.getId() != null && entity.getId() != 0 && entity.getRepeatFlag() == 1) {//修改且选择了生成后续重复日程 |
| | |
| | | |
| | | } catch (Exception e) { |
| | | //表示没有时间,需要增加00:00:00才不出错 |
| | | start = LocalDateTime.parse(entity.getStartTime() + " 00:00:00", DateTimeFormatter.ofPattern(pattern)); |
| | | start = LocalDateTime.parse(entity.getStartTime() + " 09:00:00", DateTimeFormatter.ofPattern(pattern)); |
| | | } |
| | | try { |
| | | end = LocalDateTime.parse(entity.getEndTime(), DateTimeFormatter.ofPattern(pattern)); |
| | | } catch (Exception e) { |
| | | end = LocalDateTime.parse(entity.getEndTime() + " 00:00:00", DateTimeFormatter.ofPattern(pattern)); |
| | | end = LocalDateTime.parse(entity.getEndTime() + " 09:00:00", DateTimeFormatter.ofPattern(pattern)); |
| | | } |
| | | try { |
| | | repeatEnd = LocalDateTime.parse(entity.getRepeatEnd(), DateTimeFormatter.ofPattern(pattern)); |
| | | } catch (Exception e) { |
| | | repeatEnd = LocalDateTime.parse(entity.getRepeatEnd() + " 00:00:00", DateTimeFormatter.ofPattern(pattern)); |
| | | repeatEnd = LocalDateTime.parse(entity.getRepeatEnd() + " 09:00:00", DateTimeFormatter.ofPattern(pattern)); |
| | | } |
| | | calStart.setTime(Date.from(start.atZone(ZoneId.systemDefault()).toInstant())); |
| | | //结束日期取周期性设置 |