|
@@ -84,12 +84,13 @@ public class SchedulingClassService {
|
|
|
public ResultVo<String> createByMonth(String month) {
|
|
|
CreateMonth createMonth = new CreateMonth(month, getSortAndName());
|
|
|
List<SchedulingClass> computed = createMonth.computed();
|
|
|
- dao.delete(SchedulingClass.lambdaQueryWrapper()
|
|
|
+ if (dao.selectCount(SchedulingClass.lambdaQueryWrapper()
|
|
|
.ge(SchedulingClass::getSchedulingDate, createMonth.getFirstDayOfMonth())
|
|
|
- .le(SchedulingClass::getSchedulingDate, createMonth.getLastDayOfMonth())
|
|
|
- );
|
|
|
+ .le(SchedulingClass::getSchedulingDate, createMonth.getLastDayOfMonth())) > 0) {
|
|
|
+ return R.fail(ExceptionEnum.LOGICAL_ERROR, "已经存在数据了无法生成。");
|
|
|
+ }
|
|
|
dao.insert(computed);
|
|
|
- return null;
|
|
|
+ return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
|
|
|
}
|
|
|
|
|
|
|