|
@@ -1,5 +1,15 @@
|
|
package cn.com.qmth.stmms.common.controller;
|
|
package cn.com.qmth.stmms.common.controller;
|
|
|
|
|
|
|
|
+import java.beans.PropertyEditorSupport;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+import org.apache.commons.lang3.StringEscapeUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.propertyeditors.CustomBooleanEditor;
|
|
|
|
+import org.springframework.web.bind.WebDataBinder;
|
|
|
|
+import org.springframework.web.bind.annotation.InitBinder;
|
|
|
|
+
|
|
import cn.com.qmth.stmms.biz.exam.dao.SelectiveStudentDao;
|
|
import cn.com.qmth.stmms.biz.exam.dao.SelectiveStudentDao;
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
@@ -7,23 +17,13 @@ import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
import cn.com.qmth.stmms.biz.exam.service.MarkGroupService;
|
|
import cn.com.qmth.stmms.biz.exam.service.MarkGroupService;
|
|
-import cn.com.qmth.stmms.biz.file.enums.FileType;
|
|
|
|
-import cn.com.qmth.stmms.biz.file.enums.FormatType;
|
|
|
|
import cn.com.qmth.stmms.biz.user.model.User;
|
|
import cn.com.qmth.stmms.biz.user.model.User;
|
|
import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
import cn.com.qmth.stmms.biz.utils.ScoreCalculateUtil;
|
|
import cn.com.qmth.stmms.biz.utils.ScoreCalculateUtil;
|
|
import cn.com.qmth.stmms.biz.utils.ScoreInfo;
|
|
import cn.com.qmth.stmms.biz.utils.ScoreInfo;
|
|
-import cn.com.qmth.stmms.common.enums.*;
|
|
|
|
|
|
+import cn.com.qmth.stmms.common.enums.MarkStatus;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
|
|
import cn.com.qmth.stmms.common.utils.DateUtils;
|
|
import cn.com.qmth.stmms.common.utils.DateUtils;
|
|
-import org.apache.commons.lang3.StringEscapeUtils;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.beans.propertyeditors.CustomBooleanEditor;
|
|
|
|
-import org.springframework.web.bind.WebDataBinder;
|
|
|
|
-import org.springframework.web.bind.annotation.InitBinder;
|
|
|
|
-
|
|
|
|
-import java.beans.PropertyEditorSupport;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
|
public class BaseController {
|
|
public class BaseController {
|
|
|
|
|
|
@@ -81,267 +81,286 @@ public class BaseController {
|
|
setValue(DateUtils.parseDate(text));
|
|
setValue(DateUtils.parseDate(text));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- // ExamSubjectStatus 类型转换
|
|
|
|
- binder.registerCustomEditor(ExamSubjectStatus.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(ExamSubjectStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // LibraryStatus 类型转换
|
|
|
|
- binder.registerCustomEditor(LibraryStatus.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(LibraryStatus.valueOf(text));
|
|
|
|
-// setValue(LibraryStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // Role 类型转换
|
|
|
|
- binder.registerCustomEditor(Role.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(Role.valueOf(text));
|
|
|
|
-// setValue(Role.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // UserSource 类型转换
|
|
|
|
- binder.registerCustomEditor(UserSource.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(UserSource.valueOf(text));
|
|
|
|
-// setValue(UserSource.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // MarkStatus 类型转换
|
|
|
|
- binder.registerCustomEditor(MarkStatus.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(MarkStatus.valueOf(text));
|
|
|
|
-// setValue(MarkStatus.findByName(text));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // MarkMode 类型转换
|
|
|
|
- binder.registerCustomEditor(MarkMode.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(MarkMode.valueOf(text));
|
|
|
|
-// setValue(MarkMode.findByName(text));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- // HistoryStatus 类型转换
|
|
|
|
- binder.registerCustomEditor(HistoryStatus.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(HistoryStatus.valueOf(text));
|
|
|
|
-// setValue(HistoryStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- // CheckType 类型转换
|
|
|
|
- binder.registerCustomEditor(CheckType.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(CheckType.valueOf(text));
|
|
|
|
-// setValue(CheckType.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // ObjectivePolicy 类型转换
|
|
|
|
- binder.registerCustomEditor(ObjectivePolicy.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(ObjectivePolicy.valueOf(text));
|
|
|
|
-// setValue(ObjectivePolicy.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // ExamStatus 类型转换
|
|
|
|
- binder.registerCustomEditor(ExamStatus.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(ExamStatus.valueOf(text));
|
|
|
|
-// setValue(ExamStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // ExamType 类型转换
|
|
|
|
- binder.registerCustomEditor(ExamType.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(ExamType.valueOf(text));
|
|
|
|
-// setValue(ExamType.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // LogType 类型转换
|
|
|
|
- binder.registerCustomEditor(LogType.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(LogType.valueOf(text));
|
|
|
|
-// setValue(LogType.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // FileType 类型转换
|
|
|
|
- binder.registerCustomEditor(FileType.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(FileType.valueOf(text));
|
|
|
|
-// setValue(FileType.findByText(text));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // FormatType 类型转换
|
|
|
|
- binder.registerCustomEditor(FormatType.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(FormatType.valueOf(text));
|
|
|
|
-// setValue(FormatType.findByText(text));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // ExamSource 类型转换
|
|
|
|
- binder.registerCustomEditor(ExamSource.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(ExamSource.valueOf(text));
|
|
|
|
-// setValue(ExamSource.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // SubjectiveStatus 类型转换
|
|
|
|
- binder.registerCustomEditor(SubjectiveStatus.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(SubjectiveStatus.valueOf(text));
|
|
|
|
-// setValue(SubjectiveStatus.findByText(text));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // SelectiveStatus 类型转换
|
|
|
|
- binder.registerCustomEditor(SelectiveStatus.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(SelectiveStatus.valueOf(text));
|
|
|
|
-// setValue(SelectiveStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // SystemAuthType 类型转换
|
|
|
|
- binder.registerCustomEditor(SystemAuthType.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(SystemAuthType.valueOf(text));
|
|
|
|
-// setValue(SystemAuthType.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // QuestionType 类型转换
|
|
|
|
- binder.registerCustomEditor(QuestionType.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(QuestionType.valueOf(text));
|
|
|
|
-// setValue(QuestionType.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // TrackCountPolicy 类型转换
|
|
|
|
- binder.registerCustomEditor(TrackCountPolicy.class, new PropertyEditorSupport() {
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void setAsText(String text) {
|
|
|
|
- try {
|
|
|
|
- setValue(TrackCountPolicy.valueOf(text));
|
|
|
|
-// setValue(TrackCountPolicy.findByValue(Integer.valueOf(text)));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- setValue(null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // // ExamSubjectStatus 类型转换
|
|
|
|
+ // binder.registerCustomEditor(ExamSubjectStatus.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(ExamSubjectStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // LibraryStatus 类型转换
|
|
|
|
+ // binder.registerCustomEditor(LibraryStatus.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(LibraryStatus.valueOf(text));
|
|
|
|
+ //// setValue(LibraryStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // Role 类型转换
|
|
|
|
+ // binder.registerCustomEditor(Role.class, new PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(Role.valueOf(text));
|
|
|
|
+ //// setValue(Role.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // UserSource 类型转换
|
|
|
|
+ // binder.registerCustomEditor(UserSource.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(UserSource.valueOf(text));
|
|
|
|
+ //// setValue(UserSource.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // MarkStatus 类型转换
|
|
|
|
+ // binder.registerCustomEditor(MarkStatus.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(MarkStatus.valueOf(text));
|
|
|
|
+ //// setValue(MarkStatus.findByName(text));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // MarkMode 类型转换
|
|
|
|
+ // binder.registerCustomEditor(MarkMode.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(MarkMode.valueOf(text));
|
|
|
|
+ //// setValue(MarkMode.findByName(text));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ //
|
|
|
|
+ // // HistoryStatus 类型转换
|
|
|
|
+ // binder.registerCustomEditor(HistoryStatus.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(HistoryStatus.valueOf(text));
|
|
|
|
+ //// setValue(HistoryStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ //
|
|
|
|
+ // // CheckType 类型转换
|
|
|
|
+ // binder.registerCustomEditor(CheckType.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(CheckType.valueOf(text));
|
|
|
|
+ //// setValue(CheckType.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // ObjectivePolicy 类型转换
|
|
|
|
+ // binder.registerCustomEditor(ObjectivePolicy.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(ObjectivePolicy.valueOf(text));
|
|
|
|
+ //// setValue(ObjectivePolicy.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // ExamStatus 类型转换
|
|
|
|
+ // binder.registerCustomEditor(ExamStatus.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(ExamStatus.valueOf(text));
|
|
|
|
+ //// setValue(ExamStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // ExamType 类型转换
|
|
|
|
+ // binder.registerCustomEditor(ExamType.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(ExamType.valueOf(text));
|
|
|
|
+ //// setValue(ExamType.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // LogType 类型转换
|
|
|
|
+ // binder.registerCustomEditor(LogType.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(LogType.valueOf(text));
|
|
|
|
+ //// setValue(LogType.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // FileType 类型转换
|
|
|
|
+ // binder.registerCustomEditor(FileType.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(FileType.valueOf(text));
|
|
|
|
+ //// setValue(FileType.findByText(text));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // FormatType 类型转换
|
|
|
|
+ // binder.registerCustomEditor(FormatType.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(FormatType.valueOf(text));
|
|
|
|
+ //// setValue(FormatType.findByText(text));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // ExamSource 类型转换
|
|
|
|
+ // binder.registerCustomEditor(ExamSource.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(ExamSource.valueOf(text));
|
|
|
|
+ //// setValue(ExamSource.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // SubjectiveStatus 类型转换
|
|
|
|
+ // binder.registerCustomEditor(SubjectiveStatus.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(SubjectiveStatus.valueOf(text));
|
|
|
|
+ //// setValue(SubjectiveStatus.findByText(text));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // SelectiveStatus 类型转换
|
|
|
|
+ // binder.registerCustomEditor(SelectiveStatus.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(SelectiveStatus.valueOf(text));
|
|
|
|
+ //// setValue(SelectiveStatus.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // SystemAuthType 类型转换
|
|
|
|
+ // binder.registerCustomEditor(SystemAuthType.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(SystemAuthType.valueOf(text));
|
|
|
|
+ //// setValue(SystemAuthType.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // QuestionType 类型转换
|
|
|
|
+ // binder.registerCustomEditor(QuestionType.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(QuestionType.valueOf(text));
|
|
|
|
+ //// setValue(QuestionType.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // // TrackCountPolicy 类型转换
|
|
|
|
+ // binder.registerCustomEditor(TrackCountPolicy.class, new
|
|
|
|
+ // PropertyEditorSupport() {
|
|
|
|
+ //
|
|
|
|
+ // @Override
|
|
|
|
+ // public void setAsText(String text) {
|
|
|
|
+ // try {
|
|
|
|
+ // setValue(TrackCountPolicy.valueOf(text));
|
|
|
|
+ //// setValue(TrackCountPolicy.findByValue(Integer.valueOf(text)));
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
+ // setValue(null);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
binder.registerCustomEditor(Boolean.class, new CustomBooleanEditor(true));
|
|
binder.registerCustomEditor(Boolean.class, new CustomBooleanEditor(true));
|
|
}
|
|
}
|
|
|
|
|