|
@@ -3,9 +3,9 @@ package cn.hmsoft.art.control.wish;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
-import java.util.regex.Matcher;
|
|
|
|
import java.util.regex.Pattern;
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
+import cn.hmsoft.art.helper.ArtRegexHelper;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -60,16 +60,16 @@ public class AdmisSearchControl extends AjaxControl{
|
|
public Ajax search(String cert_id, String std_name, String exam_id) {
|
|
public Ajax search(String cert_id, String std_name, String exam_id) {
|
|
this.checkStd(cert_id, std_name, exam_id);
|
|
this.checkStd(cert_id, std_name, exam_id);
|
|
String sql = "select * from wh_result where std_name =? and exam_id = ? and cert_id=?";
|
|
String sql = "select * from wh_result where std_name =? and exam_id = ? and cert_id=?";
|
|
- Map<String,Object> result = this.daoStd.findMapBySql(sql, std_name.trim(), exam_id.trim(), cert_id);
|
|
|
|
- if(result == null || result.size() == 0) {
|
|
|
|
|
|
+ Map<String, Object> result = this.daoStd.findMapBySql(sql, std_name.trim(), exam_id.trim(), cert_id);
|
|
|
|
+ if (result == null || result.isEmpty()) {
|
|
sql = "select * from wh_result where cert_id = ? ";
|
|
sql = "select * from wh_result where cert_id = ? ";
|
|
- Map<String,Object> temp = this.daoStd.findMapBySql(sql, cert_id);
|
|
|
|
- if(temp != null && temp.size() > 0) {
|
|
|
|
|
|
+ Map<String, Object> temp = this.daoStd.findMapBySql(sql, cert_id);
|
|
|
|
+ if (temp != null && !temp.isEmpty()) {
|
|
throw new BusinessException("信息填写错误,请检查!");
|
|
throw new BusinessException("信息填写错误,请检查!");
|
|
}
|
|
}
|
|
return new Ajax(result);
|
|
return new Ajax(result);
|
|
}
|
|
}
|
|
- this.daoStdLog.log(Integer.parseInt(String.valueOf(result.get("id"))),
|
|
|
|
|
|
+ this.daoStdLog.log(Integer.parseInt(String.valueOf(result.get("id"))),
|
|
StdLogType.Admis, LocalDateTime.now(), null, String.valueOf(result.get("id")));
|
|
StdLogType.Admis, LocalDateTime.now(), null, String.valueOf(result.get("id")));
|
|
return new Ajax(result);
|
|
return new Ajax(result);
|
|
}
|
|
}
|
|
@@ -82,7 +82,7 @@ public class AdmisSearchControl extends AjaxControl{
|
|
this.checkStdNy(cert_id, std_name, exam_id);
|
|
this.checkStdNy(cert_id, std_name, exam_id);
|
|
String sql = "select * from wh_result_ny where cert_id=? or std_name=? or exam_id=? ";
|
|
String sql = "select * from wh_result_ny where cert_id=? or std_name=? or exam_id=? ";
|
|
Map<String, Object> result = this.daoStd.findMapBySql(sql, cert_id, std_name ,exam_id);
|
|
Map<String, Object> result = this.daoStd.findMapBySql(sql, cert_id, std_name ,exam_id);
|
|
- if(result == null || result.size() == 0) {
|
|
|
|
|
|
+ if(result == null || result.isEmpty()) {
|
|
return new Ajax(result);
|
|
return new Ajax(result);
|
|
}
|
|
}
|
|
if(!(result.get("cert_id").equals(cert_id)||result.get("mainland_pass").equals(cert_id))||!result.get("std_name").equals(std_name)||!result.get("exam_id").equals(exam_id))
|
|
if(!(result.get("cert_id").equals(cert_id)||result.get("mainland_pass").equals(cert_id))||!result.get("std_name").equals(std_name)||!result.get("exam_id").equals(exam_id))
|
|
@@ -136,13 +136,7 @@ public class AdmisSearchControl extends AjaxControl{
|
|
|
|
|
|
@SuppressWarnings("unused")
|
|
@SuppressWarnings("unused")
|
|
private boolean HasDigit(String content) {
|
|
private boolean HasDigit(String content) {
|
|
- boolean flag = false;
|
|
|
|
- Pattern p = Pattern.compile(".*\\d+.*");
|
|
|
|
- Matcher m = p.matcher(content);
|
|
|
|
- if (m.matches()) {
|
|
|
|
- flag = true;
|
|
|
|
- }
|
|
|
|
- return flag;
|
|
|
|
|
|
+ return ArtRegexHelper.HasDigit(content);
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("wish/std/get/param.htm")
|
|
@RequestMapping("wish/std/get/param.htm")
|