Forráskód Böngészése

时间格式修改

chengyao 3 éve
szülő
commit
aeedb6204f

+ 32 - 3
src/main/java/com/diagbot/facade/DataAnalysisFacade.java

@@ -23,6 +23,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
@@ -118,7 +120,16 @@ public class DataAnalysisFacade {
 
     private void clickPageSet(GetQcClickVO getQcClickVO) {
         //入参验证
-        if (DateUtil.after(DateUtil.parseDateTime(getQcClickVO.getStartDate()),DateUtil.parseDateTime(getQcClickVO.getEndDate()))){
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date startDate = null;
+        Date endDate = null;
+        try {
+            startDate = simpleDateFormat.parse(getQcClickVO.getStartDate());
+            endDate = simpleDateFormat.parse(getQcClickVO.getEndDate());
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (DateUtil.after(startDate,endDate)){
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
         }
         getQcClickVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
@@ -126,7 +137,16 @@ public class DataAnalysisFacade {
 
     private void clickInnerPageSet(GetQcClickInnerPageVO getQcClickInnerPageVO) {
         //入参验证
-        if (DateUtil.after(DateUtil.parseDateTime(getQcClickInnerPageVO.getStartDate()),DateUtil.parseDateTime(getQcClickInnerPageVO.getEndDate()))){
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date startDate = null;
+        Date endDate = null;
+        try {
+            startDate = simpleDateFormat.parse(getQcClickInnerPageVO.getStartDate());
+            endDate = simpleDateFormat.parse(getQcClickInnerPageVO.getEndDate());
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (DateUtil.after(startDate,endDate)){
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
         }
         getQcClickInnerPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
@@ -134,7 +154,16 @@ public class DataAnalysisFacade {
 
     private void entryDefectSet(GetEntryDefectImproveVO getEntryDefectImproveVO) {
         //入参验证
-        if (DateUtil.after(DateUtil.parseDateTime(getEntryDefectImproveVO.getStartDate()),DateUtil.parseDateTime(getEntryDefectImproveVO.getEndDate()))){
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date startDate = null;
+        Date endDate = null;
+        try {
+            startDate = simpleDateFormat.parse(getEntryDefectImproveVO.getStartDate());
+            endDate = simpleDateFormat.parse(getEntryDefectImproveVO.getEndDate());
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (DateUtil.after(startDate,endDate)){
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
         }
         getEntryDefectImproveVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));

+ 1 - 2
src/main/java/com/diagbot/vo/GetEntryDefectImproveVO.java

@@ -43,9 +43,8 @@ public class GetEntryDefectImproveVO extends Page {
     private String casesName;
 
     @NotNull(message = "请输入起始时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
     private String startDate;
-    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
+
     @NotNull(message = "请输入截止时间")
     private String endDate;
 

+ 1 - 2
src/main/java/com/diagbot/vo/GetQcClickInnerPageVO.java

@@ -43,9 +43,8 @@ public class GetQcClickInnerPageVO extends Page {
     private String doctorName;
 
     @NotNull(message = "请输入起始时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
     private String startDate;
-    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
+
     @NotNull(message = "请输入截止时间")
     private String endDate;
 

+ 1 - 2
src/main/java/com/diagbot/vo/GetQcClickVO.java

@@ -47,9 +47,8 @@ public class GetQcClickVO{
 
 
     @NotNull(message = "请输入起始时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
     private String startDate;
-    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
+
     @NotNull(message = "请输入截止时间")
     private String endDate;