Просмотр исходного кода

修改日报的工作时间不可小于零

wutt 5 лет назад
Родитель
Сommit
8b575db64a

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -194,6 +194,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     public HttpRespMsg editReport(List<Report> reportList) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         for (Report report : reportList) {
+            if (report.getWorkingTime() <= 0.0) {
+                httpRespMsg.setError("工作时长必须大于零");
+                return httpRespMsg;
+            }
             if (report.getId() == null) {
                 if (reportMapper.insert(report) == 0) {
                     httpRespMsg.setError("操作失败");