|
@@ -8,6 +8,7 @@ import java.util.Map;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
import cn.hmsoft.art.data.dao.cf.CfAgentDao;
|
|
import cn.hmsoft.art.data.dao.cf.CfAgentDao;
|
|
|
|
+import cn.hmsoft.art.helper.ArtParamHelper;
|
|
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;
|
|
@@ -33,30 +34,32 @@ import cn.hmsoft.helper.StringHelper;
|
|
public class PadAppControl {
|
|
public class PadAppControl {
|
|
|
|
|
|
public static String AgentDownloadWriteStdPass = "hm2021";
|
|
public static String AgentDownloadWriteStdPass = "hm2021";
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private StdRegDao daoStd;
|
|
private StdRegDao daoStd;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private LyAgentDao daoAgent;
|
|
private LyAgentDao daoAgent;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private CfAgentDao daoCfAgent;
|
|
private CfAgentDao daoCfAgent;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private PadAppService sPadApp;
|
|
private PadAppService sPadApp;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 拍模特.
|
|
* 拍模特.
|
|
- * @param password
|
|
|
|
- * @param room_id
|
|
|
|
- * @param room_image_type
|
|
|
|
- * @param request
|
|
|
|
- * @return
|
|
|
|
|
|
+ * @param password 验证密码
|
|
|
|
+ * @param room_id 考场ID
|
|
|
|
+ * @param room_image_type 1\2\3
|
|
|
|
+ * @param request 请求体
|
|
|
|
+ * @return ajax
|
|
*/
|
|
*/
|
|
@RequestMapping("pad/photo/mote/upload")
|
|
@RequestMapping("pad/photo/mote/upload")
|
|
public Ajax uploadMoteImage(String password, int room_id, int room_image_type,
|
|
public Ajax uploadMoteImage(String password, int room_id, int room_image_type,
|
|
HttpServletRequest request) {
|
|
HttpServletRequest request) {
|
|
FrameAssertUtil.isEqual(password, AgentDownloadWriteStdPass, "密码错误,请重试");
|
|
FrameAssertUtil.isEqual(password, AgentDownloadWriteStdPass, "密码错误,请重试");
|
|
- CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(
|
|
|
|
- request.getSession().getServletContext());
|
|
|
|
|
|
+ CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(request.getSession().getServletContext());
|
|
if (multipartResolver.isMultipart(request)) {
|
|
if (multipartResolver.isMultipart(request)) {
|
|
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
|
|
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
|
|
Iterator<String> iter = multiRequest.getFileNames();
|
|
Iterator<String> iter = multiRequest.getFileNames();
|
|
@@ -75,32 +78,29 @@ public class PadAppControl {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 笔试拍照.
|
|
* 笔试拍照.
|
|
- * @param password
|
|
|
|
- * @param std_id
|
|
|
|
- * @param cert_id
|
|
|
|
- * @param agent_id
|
|
|
|
- * @param room_id
|
|
|
|
- * @param subject_id
|
|
|
|
- * @param photo_time
|
|
|
|
- * @param request
|
|
|
|
- * @return
|
|
|
|
|
|
+ * @param password 密码
|
|
|
|
+ * @param std_id 考生ID
|
|
|
|
+ * @param cert_id 考生证件号码
|
|
|
|
+ * @param agent_id 考点ID
|
|
|
|
+ * @param room_id 笔试考场ID
|
|
|
|
+ * @param subject_id 科目ID
|
|
|
|
+ * @param photo_time 拍摄时间
|
|
|
|
+ * @param request 请求体
|
|
|
|
+ * @return ajax
|
|
*/
|
|
*/
|
|
@RequestMapping("pad/photo/upload")
|
|
@RequestMapping("pad/photo/upload")
|
|
- public Ajax uploadImage(String password, Integer std_id, String cert_id,
|
|
|
|
- Integer agent_id, Integer room_id, Integer subject_id, String photo_time,
|
|
|
|
|
|
+ public Ajax uploadImage(String password, Integer std_id, String cert_id, Integer agent_id, Integer room_id, Integer subject_id, String photo_time,
|
|
HttpServletRequest request) {
|
|
HttpServletRequest request) {
|
|
FrameAssertUtil.isEqual(password, AgentDownloadWriteStdPass, "密码错误,请重试");
|
|
FrameAssertUtil.isEqual(password, AgentDownloadWriteStdPass, "密码错误,请重试");
|
|
- if (StringHelper.isEmpty(cert_id) || agent_id == null
|
|
|
|
- || StringHelper.isEmpty(subject_id))
|
|
|
|
|
|
+ if (StringHelper.isEmpty(cert_id) || agent_id == null || StringHelper.isEmpty(subject_id))
|
|
throw new BusinessException("查询考生出现错误:缺少必要的参数信息");
|
|
throw new BusinessException("查询考生出现错误:缺少必要的参数信息");
|
|
|
|
|
|
|
|
+ // 考生判断
|
|
StdReg std = daoStd.find("cert_id", cert_id);
|
|
StdReg std = daoStd.find("cert_id", cert_id);
|
|
-
|
|
|
|
FrameAssertUtil.isNotNull(std, "找不到证件号码匹配的考生信息");
|
|
FrameAssertUtil.isNotNull(std, "找不到证件号码匹配的考生信息");
|
|
FrameAssertUtil.isEqual(std.getStd_id(), std_id, "考生编号与数据库不一致");
|
|
FrameAssertUtil.isEqual(std.getStd_id(), std_id, "考生编号与数据库不一致");
|
|
|
|
|
|
- CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(
|
|
|
|
- request.getSession().getServletContext());
|
|
|
|
|
|
+ CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(request.getSession().getServletContext());
|
|
if (multipartResolver.isMultipart(request)) {
|
|
if (multipartResolver.isMultipart(request)) {
|
|
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
|
|
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
|
|
Iterator<String> iter = multiRequest.getFileNames();
|
|
Iterator<String> iter = multiRequest.getFileNames();
|
|
@@ -119,37 +119,46 @@ public class PadAppControl {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 笔试拍照考生列表.
|
|
* 笔试拍照考生列表.
|
|
- * @param password
|
|
|
|
- * @param agent_id
|
|
|
|
- * @return
|
|
|
|
|
|
+ * @param password 验证密码
|
|
|
|
+ * @param agent_id 考点Id
|
|
|
|
+ * @return ajax
|
|
*/
|
|
*/
|
|
@RequestMapping("pad/photo/std/list")
|
|
@RequestMapping("pad/photo/std/list")
|
|
- private Ajax downloadInfo(String password, String agent_id) {
|
|
|
|
- Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
|
+ public Ajax downloadInfo(String password, String agent_id) {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
FrameAssertUtil.isEqual(password, AgentDownloadWriteStdPass, "密码错误,请重试");
|
|
FrameAssertUtil.isEqual(password, AgentDownloadWriteStdPass, "密码错误,请重试");
|
|
// 科目
|
|
// 科目
|
|
//String sql = "select ly_agent_id agent_id,ly_group_id group_id,subject_id,subject_name,subject_name subject_alias,group_order,exam_start_time,exam_end_time from ly_subject sb where ly_agent_id=? and subject_type='Written' order by exam_start_time";
|
|
//String sql = "select ly_agent_id agent_id,ly_group_id group_id,subject_id,subject_name,subject_name subject_alias,group_order,exam_start_time,exam_end_time from ly_subject sb where ly_agent_id=? and subject_type='Written' order by exam_start_time";
|
|
String sql="SELECT sb.ly_agent_id agent_id,sb.ly_group_id group_id,sb.subject_id,sb.subject_name,CONCAT(sb.subject_name,'(',a.ASPECT_NAME,')') subject_alias,sb.group_order,sb.exam_start_time,sb.exam_end_time FROM ly_subject sb LEFT JOIN cf_aspect_subject cas ON cas.SUBJECT_ID=sb.SUBJECT_ID LEFT JOIN cf_aspect a ON a.ASPECT_ID=cas.ASPECT_ID WHERE ly_agent_id=? AND subject_type='Written' ORDER BY exam_start_time";
|
|
String sql="SELECT sb.ly_agent_id agent_id,sb.ly_group_id group_id,sb.subject_id,sb.subject_name,CONCAT(sb.subject_name,'(',a.ASPECT_NAME,')') subject_alias,sb.group_order,sb.exam_start_time,sb.exam_end_time FROM ly_subject sb LEFT JOIN cf_aspect_subject cas ON cas.SUBJECT_ID=sb.SUBJECT_ID LEFT JOIN cf_aspect a ON a.ASPECT_ID=cas.ASPECT_ID WHERE ly_agent_id=? AND subject_type='Written' ORDER BY exam_start_time";
|
|
map.put("SubjectArray", this.daoAgent.listMapBySql(sql, agent_id));
|
|
map.put("SubjectArray", this.daoAgent.listMapBySql(sql, agent_id));
|
|
|
|
+
|
|
// 考场
|
|
// 考场
|
|
- sql = "select ly_agent_id agent_id,ly_group_id group_id,ly_room_id room_id,room_name,room_seq,room_addr,room_capacity,room_status from ly_room_written where ly_agent_id=? and room_province='1' order by ly_group_id,room_seq";
|
|
|
|
|
|
+ //and room_province='1'
|
|
|
|
+ sql = "select ly_agent_id agent_id,ly_group_id group_id,ly_room_id room_id,room_name,room_seq,room_addr,room_capacity,room_status from ly_room_written where ly_agent_id=? order by ly_group_id,room_seq";
|
|
|
|
+ // 央美-只有中国画和造型艺术需要拍照
|
|
|
|
+ if(ArtParamHelper.SchoolCode.equals("10047")) {
|
|
|
|
+ sql = "select ly_aget_id agent_id,ly_group_id group_id,ly_room_id room_id,room_name,room_seq,room_addr,room_capacity,room_status from ly_room_written where ly_agent_id=? and (room_name like '%中国画%' or room_name like '%造型艺术%') or order by ly_group_id,room_seq ";
|
|
|
|
+ }
|
|
map.put("RoomArray", this.daoAgent.listMapBySql(sql, agent_id));
|
|
map.put("RoomArray", this.daoAgent.listMapBySql(sql, agent_id));
|
|
|
|
+
|
|
// 考生列表
|
|
// 考生列表
|
|
sql = "select std.std_id,std.cert_id,std.std_name,std.std_mobile std_mobile1,std.std_sex,t.ticket_no ticket_num,sb.subject_id,sb.ly_group_id group_id,sb.subject_name,sb.group_name,sb.ly_room_id room_id,sb.real_exam_seq exam_seq,sb.ly_room_addr room_addr,sb.ly_room_seq std_seatnumber from ly_std_subject sb,ly_std_ticket t,std_reg std where sb.std_id=t.std_id and t.std_id=std.std_id and t.ly_agent_id=sb.ly_agent_id and sb.subject_type='Written' and t.category_id=sb.category_id and sb.ly_agent_id=? order by sb.subject_id,sb.ly_room_id,sb.real_exam_seq";
|
|
sql = "select std.std_id,std.cert_id,std.std_name,std.std_mobile std_mobile1,std.std_sex,t.ticket_no ticket_num,sb.subject_id,sb.ly_group_id group_id,sb.subject_name,sb.group_name,sb.ly_room_id room_id,sb.real_exam_seq exam_seq,sb.ly_room_addr room_addr,sb.ly_room_seq std_seatnumber from ly_std_subject sb,ly_std_ticket t,std_reg std where sb.std_id=t.std_id and t.std_id=std.std_id and t.ly_agent_id=sb.ly_agent_id and sb.subject_type='Written' and t.category_id=sb.category_id and sb.ly_agent_id=? order by sb.subject_id,sb.ly_room_id,sb.real_exam_seq";
|
|
map.put("StdArray", this.daoAgent.listMapBySql(sql, agent_id));
|
|
map.put("StdArray", this.daoAgent.listMapBySql(sql, agent_id));
|
|
|
|
+
|
|
return new Ajax(map);
|
|
return new Ajax(map);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 考点列表
|
|
* 考点列表
|
|
- * @param password
|
|
|
|
- * @return
|
|
|
|
|
|
+ * @param password 密码
|
|
|
|
+ * @return ajax
|
|
*/
|
|
*/
|
|
@RequestMapping("pad/photo/agent/list")
|
|
@RequestMapping("pad/photo/agent/list")
|
|
- private Ajax getAgents(String password) {
|
|
|
|
-
|
|
|
|
|
|
+ public Ajax getAgents(String password) {
|
|
FrameAssertUtil.isEqual(password, AgentDownloadWriteStdPass, "密码错误,请重试");
|
|
FrameAssertUtil.isEqual(password, AgentDownloadWriteStdPass, "密码错误,请重试");
|
|
String sql = "select agent_id,agent_name,agent_addr from cf_agent where agent_id in (select distinct ly_agent_id from ly_group) order by enrol_start_time";
|
|
String sql = "select agent_id,agent_name,agent_addr from cf_agent where agent_id in (select distinct ly_agent_id from ly_group) order by enrol_start_time";
|
|
return new Ajax(daoCfAgent.listBySql(sql));
|
|
return new Ajax(daoCfAgent.listBySql(sql));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|