haogh 7 miesięcy temu
rodzic
commit
ac55af7ab4

+ 5 - 5
src/cn/hmsoft/art/control/cf/CfAgentAspectAppointmentControl.java

@@ -60,9 +60,9 @@ public class CfAgentAspectAppointmentControl extends AjaxControl {
 	
 
 	/** 招考方向下的容量信息
-	 * @param aspect_id
-	 * @param appointment_id
-	 * @return
+	 * @param aspect_id 招考方向ID
+	 * @param appointment_id 预约ID
+	 * @return List列表
 	 */
 	@RequestMapping("conf/agent/aspect/appointment/time")
 	public Ajax listAgentAspectAppointment(Integer aspect_id, Integer appointment_id, String appointment_date) {
@@ -70,8 +70,8 @@ public class CfAgentAspectAppointmentControl extends AjaxControl {
 	}
 	
 	/** 按天查询招考方向下的容量
-	 * @param aspect_id
-	 * @return
+	 * @param aspect_id 招考方向ID
+	 * @return List
 	 */
 	@RequestMapping("conf/agent/aspect/appointment/date")
 	public Ajax listAgentAspectAppointment(Integer aspect_id) {

+ 7 - 4
src/cn/hmsoft/art/control/cf/CfTracksControl.java

@@ -3,12 +3,15 @@ package cn.hmsoft.art.control.cf;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 import javax.servlet.ServletOutputStream;
 
+import cn.hmsoft.log.LogHelper;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -72,7 +75,7 @@ public class CfTracksControl extends ArtControl {
 	@CrossOrigin
 	@RequestMapping("conf/tracks/upload")
 	public Ajax upload(MultipartFile file) throws Exception {
-		List<List<String>> values = ExcelReaderHelper.readSheet(file.getOriginalFilename(), file.getInputStream(), 1,
+		List<List<String>> values = ExcelReaderHelper.readSheet(Objects.requireNonNull(file.getOriginalFilename()), file.getInputStream(), 1,
 				9);
 		final FrameOptr optr = this.getFrameOptr();
 		if (values.size() > 100) {
@@ -123,7 +126,7 @@ public class CfTracksControl extends ArtControl {
     	try {
 			String fileName =  "曲目库" + ".xlsx";
 			fileName = URLEncoder.encode(fileName, "UTF-8");
-			fileName = new String(fileName.getBytes(), "ISO-8859-1");
+			fileName = new String(fileName.getBytes(), StandardCharsets.ISO_8859_1);
 	    	XSSFWorkbook wb = Excel2007Writer.createExcel(values);
 	    	ByteArrayOutputStream os = new ByteArrayOutputStream();
 			wb.write(os);
@@ -133,13 +136,13 @@ public class CfTracksControl extends ArtControl {
 			outStream = this.getResponse().getOutputStream();
 			outStream.write(os.toByteArray());
 		} catch (Exception e) {
-			e.printStackTrace();
+			LogHelper.error(e.getMessage());
 		} finally {
 			if(outStream != null) {
 				try {
 					outStream.close();
 				} catch (IOException e) {
-					e.printStackTrace();
+					LogHelper.error(e.getMessage());
 				}
 			}
 		}

+ 1 - 1
src/cn/hmsoft/art/control/cf/enrol/CfEnrolParamControl.java

@@ -62,7 +62,7 @@ public class CfEnrolParamControl extends ArtControl {
 	@RequestMapping("conf/enrol/param/reload")
 	public Ajax reloadEnrolParam() throws IOException {
 		ArtParamHelper.instanceParams(true);
-		Map<String, Object> map = new HashMap<String, Object>();
+		Map<String, Object> map = new HashMap<>();
 		map.put("key_pass", SecureHelper.md5(KEY_PASS));
 		String wxUrl = ArtParamHelper.getParamValue("WeixinUrl", null);
 		if(StringHelper.isEmpty(wxUrl)) {

+ 4 - 3
src/cn/hmsoft/art/control/score/ScoreYmControl.java

@@ -19,6 +19,7 @@ import cn.hmsoft.frame.util.FrameAssertUtil;
 import cn.hmsoft.helper.StringHelper;
 import cn.hmsoft.helper.excel.ExcelReaderHelper;
 import cn.hmsoft.jdbc.entity.QueryOrder;
+import cn.hmsoft.log.LogHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -155,7 +156,7 @@ public class ScoreYmControl extends ArtControl {
 				s.getQualified_status() + "->" + score.getQualified_status());
 		sql = "select count(1) from sc_std_aspect_ym where cert_id=? and qualified_status='初审合格'";
 		Integer count = this.daoLog.findObject(Integer.class, sql, std.getCert_id());
-		if (count == null || count - 0 == 0) {
+		if (count == null || count == 0) {
 			this.daoLog.updateBySql("update std_reg set std_qualified_flag=null where std_id=?", std.getStd_id());
 		} else
 			this.daoLog.updateBySql("update std_reg set std_qualified_flag='Active' where std_id=?", std.getStd_id());
@@ -200,7 +201,7 @@ public class ScoreYmControl extends ArtControl {
 			sql = "insert into std_enrol_ems (ems_code,enrol_id,ems_time) values(?,?,?)";
 			this.daoLog.updateBySql(sql, ems_code, e == null ? null : e.getEnrol_id(), LocalDateTime.now());
 		} catch (Exception ex) {
-
+			LogHelper.error(ex.getMessage());
 		}
 		if (e != null) {
 			
@@ -217,7 +218,7 @@ public class ScoreYmControl extends ArtControl {
 	@CrossOrigin
 	@RequestMapping("score/ym/ems/upload")
 	public Ajax upload(MultipartFile file) throws Exception {
-		List<List<String>> values = ExcelReaderHelper.readSheet(file.getOriginalFilename(), file.getInputStream(), 1,
+		List<List<String>> values = ExcelReaderHelper.readSheet(Objects.requireNonNull(file.getOriginalFilename()), file.getInputStream(), 1,
 				6);
 		final FrameOptr optr = this.getFrameOptr();
 		if (values.size() > 100) {

+ 8 - 14
src/cn/hmsoft/art/control/wish/AdmisSearchControl.java

@@ -3,9 +3,9 @@ package cn.hmsoft.art.control.wish;
 import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import cn.hmsoft.art.helper.ArtRegexHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 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) {
 		this.checkStd(cert_id, std_name, exam_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 = ? ";
-			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("信息填写错误,请检查!");
 			}
 			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")));
 		return new Ajax(result);
 	}
@@ -82,7 +82,7 @@ public class AdmisSearchControl extends AjaxControl{
 		this.checkStdNy(cert_id, std_name, 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);
-		if(result == null || result.size() == 0) {
+		if(result == null || result.isEmpty()) {
 			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))
@@ -136,13 +136,7 @@ public class AdmisSearchControl extends AjaxControl{
 	
 	@SuppressWarnings("unused")
 	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")

+ 1 - 1
src/cn/hmsoft/art/service/cf/CfAgentService.java

@@ -128,7 +128,7 @@ public class CfAgentService extends ArtService {
 		for (String province_id : province_ids) {
 			CfAgentProvince p = new CfAgentProvince();
 			p.setAgent_id(agent_id);
-			p.setProvince_id(province_id +"");
+			p.setProvince_id(province_id);
 			this.daoAgent.insert(p);
 		}
 		this.log(optr, ArtOptrLogType.ConfAgent_Delete.toString(), agent.getAgent_id(),

+ 2 - 2
src/cn/hmsoft/art/service/cf/CfSubjectService.java

@@ -105,8 +105,8 @@ public class CfSubjectService extends ArtService {
 
 	
 	/**  根据科目的配置品种写入到招考方向对应的品种表中
-	 * @param subject_id
-	 * @param variety_ids
+	 * @param subject_id 科目ID
+	 * @param variety_ids 品种ID集合
 	 */
 	private void insertAspectVariety(int subject_id, Integer[] variety_ids) {
 		CfAspectSubject as = this.daoAspectSubject.findAspectBySubject(subject_id);