|
|
|
@ -1584,4 +1584,51 @@ public class BaseServiceImpl implements BaseService { |
|
|
|
responseData.setMsg("操作成功!"); |
|
|
|
return responseData; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<CalendarExceptionShiftData> getCalendarExceptionShiftData(CalendarExceptionShiftData inData){ |
|
|
|
return baseMapper.getCalendarExceptionShiftData(inData); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateCESShift(CalendarExceptionShiftData inData){ |
|
|
|
//转换日期时间 |
|
|
|
if(inData.getStartexacttime()!=null&&!"".equals(inData.getStartexacttime())){ |
|
|
|
inData.setStarttime(BigDecimal.valueOf(DateUtil.getTimeforDoule(inData.getStartexacttime()))); |
|
|
|
}else{ |
|
|
|
inData.setStarttime(new BigDecimal(0)); |
|
|
|
} |
|
|
|
if(inData.getEndexacttime()!=null&&!"".equals(inData.getEndexacttime())){ |
|
|
|
inData.setEndtime(BigDecimal.valueOf(DateUtil.getTimeforDoule(inData.getEndexacttime()))); |
|
|
|
}else{ |
|
|
|
inData.setEndtime(new BigDecimal(0)); |
|
|
|
} |
|
|
|
//判断与其他班次是否重叠 |
|
|
|
List<CalendarExceptionShiftData> LC = baseMapper.findCalendarExceptionShiftData(inData); |
|
|
|
if(LC.size()>0){ |
|
|
|
for (int x=0;x<LC.size();x++){ |
|
|
|
// if (inData.getEndexacttime().before(LC.get(x).getStartexacttime())||inData.getStartexacttime().after(LC.get(x).getEndexacttime())){ |
|
|
|
// |
|
|
|
// }else{ |
|
|
|
// responseData.setMsg("该班次时间与已存在班次重叠!"); |
|
|
|
// responseData.setCode("500"); |
|
|
|
// return responseData; |
|
|
|
// |
|
|
|
// } |
|
|
|
if (inData.getStartexacttime().before(LC.get(x).getStartexacttime())&&inData.getEndexacttime().after(LC.get(x).getStartexacttime())){ |
|
|
|
throw new RuntimeException("该班次时间与已存在班次重叠!"); |
|
|
|
} |
|
|
|
if (inData.getStartexacttime().before(LC.get(x).getEndexacttime())&&inData.getEndexacttime().after(LC.get(x).getEndexacttime())){ |
|
|
|
throw new RuntimeException("该班次时间与已存在班次重叠!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
int index = baseMapper.updateCESShift(inData); |
|
|
|
if(index==0){ |
|
|
|
throw new RuntimeException("修改失败,数据可能已被修改,请刷新页面!"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |