Browse Source

小优化

xiaochan 1 month ago
parent
commit
d1b12b1f94

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>13.4.3</version>
+    <version>13.4.4</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 5 - 4
src/main/java/thyyxxk/webserver/service/settings/SchedulingClass/SchedulingClassService.java

@@ -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);
     }