diff --git a/src/main/java/com/cm/inspection/controller/app/apis/publicareareport/PublicAreaReportAppController.java b/src/main/java/com/cm/inspection/controller/app/apis/publicareareport/PublicAreaReportAppController.java index 3e51c03..9c93bdd 100644 --- a/src/main/java/com/cm/inspection/controller/app/apis/publicareareport/PublicAreaReportAppController.java +++ b/src/main/java/com/cm/inspection/controller/app/apis/publicareareport/PublicAreaReportAppController.java @@ -50,6 +50,9 @@ public class PublicAreaReportAppController extends AbstractController { if (publicAreaReportVO.getCheckType() != 1) { throw new ParamsException("检查类型错误"); } + if (!RegexUtil.isDatetime(publicAreaReportVO.getCheckDate())) { + throw new ParamsException("检查日期格式不正确"); + } return publicAreaReportService.savePublicAreaReportByToken(token, publicAreaReportVO); } @@ -80,6 +83,9 @@ public class PublicAreaReportAppController extends AbstractController { if (publicAreaReportVO.getCheckType() != 2 && publicAreaReportVO.getCheckType() != 3) { throw new ParamsException("检查类型错误"); } + if(!RegexUtil.isDatetime(publicAreaReportVO.getRecheckDate())) { + throw new ParamsException("复查日期格式不正确"); + } return publicAreaReportService.updatePublicAreaReportByToken(token, publicAreaReportId, publicAreaReportVO); }