|
@@ -41,6 +41,23 @@ public class CardImportTask extends AbstractTask {
|
|
|
if (StringUtils.isBlank(subjectCode)) {
|
|
|
throw new StatusException("【scan.tool.subject-code】未配置!");
|
|
|
}
|
|
|
+ String paperCount = SysProperty.PAPER_COUNT;
|
|
|
+ if (StringUtils.isBlank(paperCount)) {
|
|
|
+ throw new StatusException("【scan.tool.paper-count】未配置!");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ Integer.valueOf(paperCount);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new StatusException("【scan.tool.paper-count】值应为数字!");
|
|
|
+ }
|
|
|
+ String singlePage = SysProperty.SINGLE_PAGE;
|
|
|
+ if (StringUtils.isBlank(singlePage)) {
|
|
|
+ throw new StatusException("【scan.tool.single-page】未配置!");
|
|
|
+ }
|
|
|
+ singlePage=singlePage.trim();
|
|
|
+ if(!"true".equals(singlePage)&&!"false".equals(singlePage)) {
|
|
|
+ throw new StatusException("【scan.tool.single-page】值应为true或者false!");
|
|
|
+ }
|
|
|
if (CommonService.findExam(examId) == null) {
|
|
|
throw new StatusException("当前考试不存在!examId = " + examId);
|
|
|
}
|
|
@@ -53,8 +70,8 @@ public class CardImportTask extends AbstractTask {
|
|
|
Map<String, String> params = Maps.newHashMap();
|
|
|
params.put("examId", examId.toString());
|
|
|
params.put("subjectCode", subjectCode);
|
|
|
- params.put("paperCount","2");
|
|
|
- params.put("singlePage", "false");
|
|
|
+ params.put("paperCount",paperCount);
|
|
|
+ params.put("singlePage", singlePage);
|
|
|
params.put("md5", MD5Util.md5Hex(file));
|
|
|
String ret=HttpHelper.post(url, params,file);
|
|
|
log.info("处理完毕,卡格式编号:"+ret);
|